Inserting a Script for Visual Processes

To quickly generate VB.NET script for frequently used tasks, click the Insert Script button. The following options are available:

  1. In the Code field, enter the name of the alert code.

  2. In the Message field, provide an alert message.

  1. In the Command field, enter the command line text.

  2. In the Parameters field, specify the parameters to be passed to the program or batch file (you can also use the naming macros).

  3. Select one of the options:

Note: If the command line does not complete, Automator will wait indefinitely until it completes or is terminated.

  1. Click Insert to add the script.

Here is some sample code generated by the Insert Script.

If Shell("""c:\test.bat""",AppWinstyle.Hide,True,10000) <>0 Then

'TODO: Handle command timeout here.

End If


NOTE: Command lines are executed by the .NET service, which for security reasons does not allow the application to show a user interface. Please ensure that any command lines or applications you run do not require a user interface and shut themselves down after completion. In addition, be sure to specify a timeout value after which Automator will kill the offending process if you do not want Automator to hold up processing altogether. If no timeout is specified, Automator will wait forever until the command line returns. If you specify a timeout that is exceeded, then you can deal with that condition in your script.