I have the following question. A friend of mine made a DOS based exe for file conversions. I have to type within the DOS promt the name of the exe and the flags it needs. the flags differ a lot i.e. resolution, file size .....
Is there a way to directly do this from the script editor.
My solution now is to write the lines of commands to a batch file and run the batch file.
Start is a subshell command for windows applications it forks the execution. ome comd apps doent like it. secondly you usually need to point them to files and yu really ought to type \ instead of /
system is by itself the cmd.exe, so you won't call the cmd.exe.
system load filename: opens the filename with the default application (like when you double click on a non exe file. eg. *.doc). You don't want that.
system pathToExe.exe: starts the executable and blocks maya until the pathToExe.exe application closes. You may want that. system start pathToExe.exe: starts the executable without blocking. This may be what you want.
take a look at this one: system("start \"C:\App\Nero 7\Nero WaveEditor\waveedit.exe\" \"" + $fileName + "\"");
this is the same as 1) launching cmd.exe 2) typing in "C:\App\Nero 7\Nero WaveEditor\waveedit.exe" "c:\filename.wav"
In the nero example above there is this part \"" + $fileName + "\" this is to end up wiht a string "c:\path to file\file.wav" in quotes because else the command would fail because the waveedit exe would think that only c:\path is the filename. then the wort to would be erroneously passed in as the second argument and file\file.wav as the third argument.
QUOTE(Daniel_Faus @ 08/09/07, 11:29 PM) [snapback]271276[/snapback] take a look at this one: system("start \"C:\App\Nero 7\Nero WaveEditor\waveedit.exe\" \"" + $fileName + "\"");
this is the same as 1) launching cmd.exe 2) typing in "C:\App\Nero 7\Nero WaveEditor\waveedit.exe" "c:\filename.wav"
well actually not, system itself is like launching cmd, but if you launched cmd from cmd you end up with one cmd window And the program, start just forks the execution environment (otherwise maya would wait for the program to terminate to continue the script) without a extra cmd session.