tags:

views:

32

answers:

3

Hi,

I am executing the below script, but it is not working as there are spaces in between. Below is the script:

move C:\abc\d\System Table\Table Six (Top)\LogFiles*.jpg D:\Archive\

How can we eliminate the spaces in between & make sure the system understands so that it moved all jpg files to D:\Archive

Regards, Orbit

+2  A: 

Wrap long filenames in double quotes.

move "C:\abc\d\System Table\Table Six (Top)\LogFiles*.jpg" "D:\Archive\"
James Curran
+3  A: 

Place quotes around the file names. That indications to the command line parser that everything between the quotes is a single token

move "C:\abc\d\System Table\Table Six (Top)\LogFiles*.jpg" "D:\Archive\"
shf301
+1  A: 

For more DOS batch file commands and syntax, http://www.dostips.com/ has a pretty good list and lots of examples.

As an alternative, you could use the 8.3 representation and remove the spaces (though I prefer the quotes and spaces).

move C:\abc\d\System Table\Table Six (Top)\LogFiles*.jpg D:\Archive\

move C:\abc\d\System~1\Tables~1\LogFiles*.jpg D:\Archive\

If you have other similarly named directories, the ~? could be different.

Edward Leno
thanks a lot. Issue is now fixed :)
orbit
Nice reference, +1
NealB