Execution of batch files from event table

You can discuss anything concerning Clarity in this section.
Post Reply
ScottHorn
Posts: 24
Joined: Thu Jul 30, 2009 7:49 pm

Execution of batch files from event table

Post 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.
Scott Horn

User avatar
Daniel Mentlik
DataApex Support
DataApex Support
Posts: 353
Joined: Fri Mar 27, 2009 3:15 pm

Re: Execution of batch files from event table

Post 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
Daniel Mentlí­k
DataApex

Post Reply