[Closed] MAXSCRIPT – Dos Command not working..? path error?
Hi,
could someone explain to me why this DOS Command does not seem to execute anything?
DOSCommand (“C://Program Files//WinZip//winzip32.exe” + ” -a ” + “D://rr_bumper_05.zip” + ” ” + “D://rr_bumper_05.igs”)
Winzip has a command line which allows “-a” to add a file to a new zip file called “rr_bumper_05.zip” by compressing a file called “rr_bumper_05.igs”, but it doesn’t seem to work.
If I manually type this into a dos prompt it works fine…something to do with paths or spaces between words such as “Program” and “Files” in the path, maybe.
Any help would be great.
Thx,
Mike
To use DOSCommand and shelllaunch with path names containing spaces, you have to enclose the whole path in an additional set of quotation marks.
So instead of
DOSCommand “c:\Program Files\SomeProgram.exe -a -b -c”
you have to say
DOSCommand ““c:\Program Files\SomeProgram.exe” -a -b -c”
Otherwise the command prompt would see “c:\Program” as the first part of a command and attempt to run it, assuming the stuff after the space is some parameter and not part of the file path. DOS did not support long file names or spaces in paths, so the Windows prompt had to allow the use of quotation marks to delimit paths that belong together. Same applies to paths in desktop shortcuts – you will notice that the path to 3dsmax.exe is in quotes now because it resides in c:\Program Files, while the path to c:\3dsmax7\3dsmax.exe in the Max 7 desktop shortcut is not in quotes…