8 votes
Date Updated:: 

For those of you that maintain your own dlx with a grab bag of
maxscript extensions (like Larry's avg_dlx), I've attached source for a
function that will launch a dos command in a hidden window. You may
find it useful in your toolbox.

'HiddenDOSCommand' looks like
DOSCommand, but runs more like ShellLaunch. Because it doesn't open a
window, it's less annoying for simple commands.

The calling syntax is:

HiddenDOSCommand [startpath:unsupplied] [prompt:unsupplied] [donotwait:false]

'startpath' allows you to set the starting folder for the command.
allows you to set the prompt that appears on the Max prompt line (just
below the viewports). If you don't change it, the command string is
'donotwait' allows you to decide whether or not you want
to return control to back to maxscript while the command runs, or wait
for completion.

NOTE: You must redirect any output generated to
a file if you are interested in the text that would normally be printed
to the console.

Example usage:
HiddenDOSCommand 'dir > %temp%\\hiddencmdout.tmp' startpath:'c:\\'
cmd = 'echo The time is ' + localTime + ' >> %temp%\\hiddencmdout.tmp'
HiddenDOSCommand cmd
HiddenDOSCommand 'notepad %temp%\\hiddencmdout.tmp' prompt:'Waiting for Notepad to exit'
HiddenDOSCommand 'del %temp%\\hiddencmd.tmp' donotwait:true

archive contains a compiled version of the dlx as well a simple VStudio
2003 project to build it. You will need to futz with the embedded paths
if you try to build with the included vcproj file.

Version Requirement: 
3ds max 7
HiddenDOSCommand.zip8.37 KB