Running batch files from inside Softimage


You can use the System command:

var sCommandLine = "C:\\users\\blairs\\test.bat";  
System( sCommandLine );

You can also use WScript.Shell:

// Use XSIFactory.CreateActiveXObject if in NetView
var wsh = new ActiveXObject("WScript.Shell");
wsh.run ("c:\\temp\\_SI.bat" )

If you want to use XSIUtils.LaunchProcess, you will have to do something like

XSIUtils.LaunchProcess( "cmd /C start C:\\test.bat" );

LaunchProcess is like the Win32 CreateProcess() api. You have to start a command interpreter session to run your batch file.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s