Jump to content
  • Advertisement
Sign in to follow this  
bepawuca

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!