This feature allows you to run executable programs. To run shell commands, batch/script files, you will need to launch the appropriate shell as an executable and use the shell to run the command.
Command Line
Executables: If you want to simply launch an executable,
browse to it, or enter it manually. Example:
c:\winnt\notepad.exe
If the path to your executable includes spaces, enter the path to the
executable in quotes. Example:
"c:\program files\myexe.exe"
If you want to enter a commandline paramater to pass to your executable,
enter a space between the path and the parameter. Leave spaces between
any subsequent parameters. Example:
"c:\program files\myexe.exe" par1 par2
For Shell commands, and batch or script files: the syntax required varies by operating systems. Examples of batch commands for Win 95/98, WinNT/2000pro, Unix, and Mac OS X are listed at the end of this section. For Windows, additional examples of commands to launch Microsoft Access, Powerpoint, and Word macros can be found in the tutorial section.
This field also supports dynamic variables.
For example, to launch a batch file and pass it the current time, use:
c:\data\test.bat $%DATE::hh:mm:ss%$
Working Directory
The working directory is required for your program, command or script
to run correctly. This is particular true if the program or script
uses relative paths to access and output to files.
Environment Variables
This is an array of strings, each element of which has environment
variable settings in format name=value. You should separate each name=value
pair by a delimiter character. You can choose the delimiter to separate
each element. The default delimiter is ^. If any of your variable
name=value pairs contains the ^ character then you should set another character
as your delimiter. The delimiter cannot be "=" or any other character that
appears in your name=value pairs.
Example of correctly formatted environment variables on windows systems:
PATH=c:\test;c:\test2;c:\test3^TEMP=c:\temp
This field also supports dynamic variables.
For example, to launch a batch file and set the variable 'CUSTOM_DATE',
use:
CUSTOM_DATE=$%DATE::Qqq dd, YY HH:mm:ss am_pm%$
This will set the variable CUSTOM_DATE in the batch file to: Aug 21,
2002 10:21:23 AM etc..
Termination Time
The termination time is the maximum time that your program or script
can run. The task will terminate your program if it is still running
after the maximum allowed time. Enter a value = 0, if you do not
want to terminate your program. In this case, the task will wait
indefinitely for your task to finish.
Polling interval
While your program or script is running, the task continuously polls
your program/script to see if it has completed and to obtain the Exit Code
value when it exits. You can select the polling interval (default
= 15 seconds). The minimum interval is 1 second. We recommend using
15 seconds unless you absolutely need quick feedback as soon as your task
completes. The scheduling data in the Schedule
Tasks table will be updated only when the task obtains an Exit Code
value from your program or script.
1) Executable programs:
Command line = c:\windows\notepad.exe
Working Directory = c:\windows
2) Batch files (uses command.com, located usually in c:\windows or in
c:\)
Command line = c:\windows\command.com /c c:\test\test.bat
Working Directory = c:\test
NOTE: you can also try and run batch files just like an executable depending
on your system setup.
Command line = c:\test\test.bat
3) Shell commands (uses command.com, located usually in c:\windows or
in c:\)
Command line = c:\windows\command.com /c set > c:\test\set.txt
Working Directory = c:\windows
(this example will output all your environment variables to the file
set.txt)
1) Executable programs:
Command line = c:\winnt\notepad.exe
Working Directory = c:\winnt
2) Batch files (uses cmd.exe, located usually in c:\winnt or c:\winnt\system32)
Command line = c:\winnt\system32\cmd.exe /c c:\test\test.bat
Working Directory = c:\test
NOTE: you can also try and run batch files just like an executable depending
on your system setup.
Command line = c:\test\test.bat
3) Shell commands (uses cmd.exe, located usually in c:\winnt or c:\winnt\system32)
Command line = c:\winnt\system32\cmd.exe /c set > c:\test\set.txt
Working Directory = c:\winnt\system32
(this example will output all your environment variables to the file
set.txt)
Unix (Solaris, Linux, MacosX or other)
To run shell commands or scripts, you will need to launch the appropriate
shell as an executable and use the shell to run the command.
Example to run the script 'myscript' from the /home/name directory
using the 'sh' command interpreter:
Commandline = sh myscript
Working Dir = /home/name
use man sh, man csh, man bash etc.. to see the options available to run your script.
Another option to run a shell script or command on Unix systems is to use the Telnet Task. Using the Telnet task, login to the local system, 'cd' to the desired directory using a first telnet command, and then run the shell script or command using a second telnet command.
1. AppleScripts: Use the 'osascript' command to launch
your AppleScripts
Example:
Commandline = /usr/bin/osascript /user/Name/YourScript.scpt
Working Dir = /user/Name
2. Launch Applications or files: You can also use the 'open'
command that is inbuilt into MacOS X to open a document or application
Example:
Command Line = open Stickies.app
Working Dir = /Applications
3. Commandline: To run shell commands or scripts,
please see the section on Unix above.