Public Group

Using the Command Line and Paths with Spaces

This topic is 3414 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

In the command line, sometimes I need to execute a command whose path includes spaces, i.e. C:\Program Files\Stuff\doStuff.exe I am aware that you surround a path including spaces with double quotes, but the problem arises when I need to use a command that has parameters: "C:\Program Files\Stuff\doStuff.exe" "C:\Users\Me\Documents\stuff.txt" When I tried doing the above, I got an error message: "The system cannot find the path specified." Anyone know how to fix this?

Share on other sites
That should be how you do it.. What if you cd to "C:\Program Files\Stuff" and instead do

doStuff.exe "C:\Users\Me\Documents\stuff.txt"

Share on other sites
HomerSp - Thanks for the tip, but I'd prefer to have a more elegant solution than to monkey with the directory the command line starts from.

Share on other sites
Well i do know years ago before win 3.1 and even into 3.1 you could do something like say Program~1 in place and that fixed it. I don't know if you can still do this or not. You might find it under google for old dos stuff and hey it may still work but again idk if that will help any at all

Share on other sites
Perhaps you have just mistyped something. And another thing, don't put your programs in Program Files or anything containing spaces (doesn't Program Files have more limited permissions?) :)

If you have many programs in a Stuff folder you can create a desktop shortcut to command exe and set it to begin in that folder in the shortcut properties.

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 23
• 40
• 23
• 13
• 13
• Forum Statistics

• Total Topics
631733
• Total Posts
3001928
×