PDA

View Full Version : run BAT file through MEL


Doogie
03-28-2004, 08:48 PM
I'm trying to run a BAT file that's in a different folder than maya/bin (it's in the user's scripts forlder to be exact) and I'm having trouble getting the system command to work right. Here's my best guess at it:

system ("\"%USERPROFILE%\My Documents\maya\5.0\scripts\webUpdate.bat\"");
// Result: 'C:\Documents' is not recognized as an internal or external command, operable program or batch file.
//

typing in "%USERPROFILE%\My Documents\maya\5.0\scripts\webUpdate.bat" (with quotes) from the DOS prompt works super.

Any suggestions?

(oh, and im not worried, this is for NT only)

JFFORTIN
03-28-2004, 10:29 PM
hi goggie this work for me

system("start D:/run.bat" );

Doogie
03-28-2004, 10:53 PM
Running the bat file wasnt a problem, it was the crazy path (which included spaces).

I got it working using this:
string $daScriptDir=`internalVar -userScriptDir`;
system ("start "+$daScriptDir+"update.bat");

thanks for the suggestion though.

CGTalk Moderation
01-17-2006, 09:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.