Created
March 16, 2012 22:19
-
-
Save blackbfm-zz/2053217 to your computer and use it in GitHub Desktop.
copyb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import shutil | |
import os | |
if len(sys.argv) == 1: | |
dragndropfile = open('dragndrop.reg', 'w') | |
dragndropfile.write('Windows Registry Editor Version 5.00\r\n\r\n' + | |
'[HKEY_CLASSES_ROOT\Python.File\shellex\DropHandler]\r\n' + | |
'@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"\r\n') | |
dragndropfile.close | |
exit(0) | |
os.chdir(os.path.dirname(sys.argv[0])) | |
outputname = str(raw_input('Output filename: ')) | |
outputfile = open(outputname, 'wb') | |
for file in sys.argv[1:]: | |
inputfile = open(file,'rb') | |
print 'copying ', file | |
shutil.copyfileobj(inputfile,outputfile) | |
inputfile.close() | |
outputfile.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment