HiddenDOSCommand
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.
'prompt'
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
displayed.
'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
The
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.
Attachment | Size |
---|---|
HiddenDOSCommand.zip | 8.37 KB |
Comments
Thanks, it was quite useful
Thanks, it was quite useful and helpful top resume reviews for me. I was unaware of these hidden features and today you resolved my issues. Obliged to have such remarkable websites that are working beyond the limits.