1.

Solve : Dos- Changing file name string handling?

Answer»

i have set of files in folder as XYZ*.ZIP, i WANT to copy these files to source as *.zit EXCLUDING XYZ from file name? how to handle strings in DOS batch files or other way to handle this?Only thing I was able to COME up with was to do a rename on all and then copy. Not familiar with a method of doing a rename during a copy. Below is what I'd suggest.

ren *.zip *.zit
copy *.zit
Once completed you could just rename back.
ren *.zit *.zipMy file name is like XYZab123.zip, i want to copy as ab123.zit i.e remove XYZ from file name ...Create a batch file with the following line:

if exist ***ab123.zip copy ***ab123.zip > ab123.zit

Name this batch file change.bat or whatever you desire.
Put this batch file in same directory as files you are working with.



Discussion

No Comment Found