MAXScript provides two methods for executing external programs - DOSCommand() and ShellLaunch().
DOSCommand() takes a DOS command as a string and send it to the system for execution. It has the form:
DOSCommand "delete c:\\temp\\foo.dat"
DOSCommand ("copy " + source_file + " " + dest_folder)
You can use this function to launch other programs, for example, or perform such tasks as gathering all the material texture and displacement image files in your scene into one folder.
The DOSCommand() function returns an integer which is the status result returned by the executed system command.
ShellLaunch() emulates the double-clicking on a specified file in Windows.
It has the form:
Whatever you send to ShellLaunch will be run by the Windows shell automatically.
ShellLaunch "E:\\tests\\lookup.html" ""
would launch the default Web Browser with lookup.html.
file-name extension is not specified in
shellLaunch "e:/program files/ucalc/ucalc" ""
will execute the ucalc.exe file in the specified directory.
shellLaunch "e:/t.avi" "/play /loop"
Will launch the application associated with .avi files, and pass /play and /loop as command line parameters.