Problem with copying files via CLI

Quiltface

Active Member
I am trying to move files via the CLI... Lets say the file names are...

00009^20090411^00^Test Report^5 .stats^.rpt

I want to be able to move all the files that are from april in a command.

however my command of

move C:\test\00009^200904* d:\test

gives me an error of...

"A duplicate file name exists, or the file cannot be found."

however

move c:\test\00009^* d:\test

works just fine... but then ALL of the files get moved and not just the ones from that month. I cannot change the name of the files they are generated by a program
 
You should look into writing a small batch file that will loop through said directory and copy files you need done.

Unfortunately I don't know the windows command line like I do Unix. If you do this form a Linux box I could help you write a shell script.

Give me a bit and I can try to dabble my way through the windows stuff it can't be that hard.
 
actually it just dawned on me. Try looking into robocopy, it is in the resource kit and also I think standard now in Vista & Win7.
 
apparently the CLI is blind to the ^ i found this out when i tried to use robocopy and it said it diplayed my file as 00009200904...


so i just used quotes..


move c:\test\"00009^2000904"* d:\test

I hope this helps someone in the future.

Im kind of smacking myself for not thinking of that earlier.
 
yeah so just syntax error hehe I was waiting until I got home today to test it out since I don't have a windows machine near me at work....kind of weird that all my life I have had nothing but windows boxes near me, now at this job my whole office is nothing but Macs.

I just remembered robocopy being like a billion times more robust than just copy and move and it would spit out errors for you as well.

Glad it worked.
 
Back
Top