Page 1 of 1

Execution of batch files from event table

Posted: Wed Apr 25, 2012 8:52 pm
by ScottHorn
I'm using a method which involves executing multiple batch files from the event table. When these files are executed, the command prompt window briefly appears until the batch file finishes. I am concerned about accidentally closing this window or entering text accidentally if it pops up at the wrong time as well if interference with other tasks. I would like the batch files to be executed with the command prompt window minimized or hidden. I've tried using the windows "start /min xxx.bat" command line function by putting it into the parameter field for the "run program" event, but clarity fails to execute the file. I've also tried to execute a shortcut (.lnk) file with "run minimized" checked as an option, but with no luck. Is there a way to get Clarity to execute the programs minimized or hidden (at least in the case of .bat files). I've looked for ways to handle this using windows, but the "start /min" command line option was all I could find.

Re: Execution of batch files from event table

Posted: Fri Apr 27, 2012 11:29 am
by Daniel Mentlik
Dear Scott,
there is a way around this, even if Clarity itself cannot run the program with the "start /min" parameter.

For this to work, you have to run not your desired program, but cmd instead. In the parameter field, use the "/C start /min yourprogram.bat parameters-of-your-program", for example

Code: Select all

/C start /min start.bat myfile.txt
This will cause the cmd command to be called, the c/ parameter causes it to run the start.bat batch file and close itself immediately, and the start.bat file would be run minimized with a parameter of myfile.txt (if that's applicable for you). For more clarity, look at the attached screenshot:
batch-minimized.png
Hope that helps.

Best Regards,
Daniel