run BAT file through MEL

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  03 March 2004
run BAT file through MEL

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)
Note: any errors of fact are directly attributable to me not knowing of what I speak
  03 March 2004
hi goggie this work for me

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

  03 March 2004
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.
Note: any errors of fact are directly attributable to me not knowing of what I speak
  01 January 2006
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 09:23 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.