Link to home
Start Free TrialLog in
Avatar of smm57
smm57Flag for United States of America

asked on

Windows Command line basics

I need a .cmd file to create a directory based on value supplied as arg 2 and copy all of the files from a directory whose name is partially suppllied by arg1

I want to be able to enter "test  1234 5678" and have a directory named 5678ver made and all of the files copied from 1234ver into it.

I cut/pasted what I have done thus far and for some reason it does not do the copy....the directory gets created OK but the files do not get copied....



echo on
if "%1"=="" goto badArgs
if "%2"=="" goto badArgs
mkdir %2%ver
copy "%1%ver\*.for %2%ver\*.*"  
goto exit

:badArgs
Echo "Old and new numbers required as start arguments"
:exit
ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smm57

ASKER

Yes, that did it thanks