Set a path variable with spaces in the path in a Windows .cmd file or batch file -
I'm new to scriptwriting and can not get it to do one thing. If I have moved the files on the path without any space, but I want to work it with space, if it can be possible
I have a folder with a .cmd file in Office updates Want to get a bunch To make the batch file usable on any computer, I have set a path variable, which I have to change to run only on one machine in another place. The problem is that there is a place in it on the way. If I put quotes around the path in the definition, then cmd.exe keeps them around the path before they add file names and switches and fails with the batch "command line syntax error". Without the quote, it fails, "Internal or external commands are not recognized as operative programs or batch files."
To test, I am using the help switch until I can get it working. I can do this using the file / folder name (like my document as MyDocu ~ 1), but can it be done in a different way?
Try something like this:
SET MY_PATH = C : \ Folder with a location "% MY_PATH% \ MyProgram.exe" / switch1 / switch2
Comments
Post a Comment