Dos help
Author
Discussion

8

Original Poster:

1,423 posts

293 months

Thursday 4th August 2005
quotequote all
Hi,

I'm trying to write a dos batch file to copy documents from one location to another. Whwn I run the file I get 'The syntax of the command is incorrect'. I'm guessing this is because I have spaces in the directory to copy to, example:

c:\Program Files\Common Files\etc

Anyone know how to get round this?

pdV6

16,442 posts

291 months

Thursday 4th August 2005
quotequote all
Yes - enclose the whole path or path & filename in double quotes, e.g.

copy "c:\Program Files\My Silly Filename.txt" "c:\My Silly Path"

>> Edited by pdV6 on Thursday 4th August 12:46

ThatPhilBrettGuy

11,810 posts

270 months

Thursday 4th August 2005
quotequote all
Just put "" around the string

Editted to say too slow damn it!

>> Edited by ThatPhilBrettGuy on Thursday 4th August 12:43

BliarOut

72,863 posts

269 months

Thursday 4th August 2005
quotequote all
Or use the 8.3 file names

8

Original Poster:

1,423 posts

293 months

Thursday 4th August 2005
quotequote all
Thanks guys.

:incident closed: