I'm tried to run a command line something like this: start /max C:\Program files\foo\ba.exe -somearguments.
But I have a problem, the cmd returns an error message something like The system cannot found the C:\Program file and if I put the C:\Program files\foo\ba.exe around quotes, it simply run a new window cmd in MAX mode and don't run the program.
How to fix this?
04 Answers
All filenames and paths which contain spaces must be quoted.
Next, regarding your question, how about stating the path like:
start /max /d"C:\Program files\foo\" ba.exe -somearguments 1 The error happened because the system interpreted your command as the file C:\Program and file as an argument of your command. Obviously it doesn't find the file Program and returned this error.
To fix it, just include "" on the path between the words with the space character or on entire path:
start /max C:\"Program files"\foo\ba.exe -someargumentsor
start /max "C:\Program files\foo\ba.exe" -somearguments 7 Although wrapping the path in quotes is the easiest and clearest to read, you can also use the old DOS short names (since DOS followed 8.3 naming, file names longer than 8 characters were truncated with ~1) for files. These names do not have spaces. You can see the short names for files with the DIR /X command.
In Win10 you can try this:
start /max C:\Program%20files\foo\ba.exe -somearguments 1