Skip to content

Instantly share code, notes, and snippets.

@blackbfm-zz
Created March 16, 2012 22:19
Show Gist options
  • Save blackbfm-zz/2053217 to your computer and use it in GitHub Desktop.
Save blackbfm-zz/2053217 to your computer and use it in GitHub Desktop.
copyb
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