[Tutor] Convert my .bat and .vbs to .py

Mark Bystry mabystry at verizon.net
Thu Feb 15 18:04:18 CET 2007


Hello,

This is my first post. I have just begun to code with python. My goal is to convert about a dozen or 
so DOS/Windows batch scripts(.bat) and vbscripts(.vbs) that I use on a day-to-day basis to python so 
that they can be run on either my windows or linux workstations.

The first things that I want to learn is how to do basic stuff like copying, moving, and deleting 
files around from folder to folder. I have been in the help section of python (copyfile section) 
but I do not understand what I am doing wrong.


Here is my simple DOS batch file...

######################################################################
copy D:\PDF_Holding\*PRODUCTION.pdf Z:\
copy D:\PDF_Holding\*ILLUSTRATION.pdf H:\MARKETING\ILLUSTRATIONS\PRODUCT
pause

del *.pdf
######################################################################

Basically, it copies the "production" and "illustration" pdf files to certain folders than deletes 
the left over pdf files when done. Yes, I could move them instead of copying them.

I'm no asking for anyone to write this for me but if someone could lead me i the right direction, I 
would be grateful.

Thank-you.

Mark


More information about the Tutor mailing list