|
Process - Execute |
Top Previous Next |
|
This is the Add/Edit task -> Execute tab.
Command Enter full path and name to the executable file. The rightmost button opens a file browser for selection. The only mandatory parameter in the Execute window.
Arguments Arguments don't have to start with a space key, look at the Add task view for an example. Use "" around long arguments.
Working directory This option may be used if you for example want to execute a PHP script which has no absolute links. Let say that the PHP script tries to write a file "test.txt". If you specify a working directory, you also specify where PHP will write the file. If not specified in this case, PHP will write the file where php.exe is stored, not where the script is stored (that is because the Working Directory by default will be where the command is located, in this case php.exe is the task and the script is the argument).
Run in hidden window When checked, VisualCron will run the task in hidden mode which means that if a task normally creates a window, this will not be displayed. If you want to hide a GUI application (winform) you must also check Use shell execute.
Use shell execute False is unchecked and true refers to checked.
This setting concerns whether or not to use the operating system shell to start the process. Default is unchecked which means that the process is created directly from the executable file instead of (checked) use the shell when starting the process.
The Working Directory property behaves differently when Use shell execute is true than when Use shell execute is false. When Use shell execute is true, Working Directory specifies the location of the executable. If Working Directory is an empty string, the current directory is understood to contain the executable. When Use shell execute is false, the Working Directory property is not used to find the executable. Instead, it is used by the process that is launched and only has meaning within the context of the new process.
Setting this property to false enables you to redirect input, output, and error streams.
One reason to use shell execute is when you want to run a GUI application (winform) in hidden mode and not want output of the application. To make a winform application hidden you must use shell execute in combination with run in hidden window.
The Run task as functionality currently only works for the Task type "Execute". Select appropriate Credentials in the select box. You can add new credentials by clicking on the Manage credentials button.
You are also able to specify Logon type, for which there are two options:
Note about domain: If the user belongs to a domain you must specify that domain. If the computer is not connected to a domain you should use the exact computer name. This can be found when opening "My computer". Note about arguments/parameters: Use "" around arguments.
Run with API code When using this option all processes as started through an API call of Win32 API. This is the default option. Don't change this unless you get problems with Access Denied when opening Desktop in the log file.
Run with managed code When using this option the all processes are started through the managed wrapper of the API. Don't change to this setting unless you get problems with Access Denied when opening Desktop in the log file.
Process priority VisualCron tasks can be run with any standard process priority. The following priorities are available:
Don't start task if task process is already running If you want VisualCron to start a task only if a process is NOT running, then check this box and enter the name of the process. The process name must be an existing process, for convenience use the "3-dotsbutton" and pick that process (ensure that it is running before you open the window).
Kill process / Close main window Instead of adding two tasks, one execute and one kill, you can specify the time the main window or process should be active. If you for example check the box and specify "Kill process" after "1 minute(s)", the task will start and then terminated after exactly one minute. However, try "Close main window" instead of "Kill process". Killing the process is harder and may interrupt the process if it is trying to save anything on exit. Kill may also result in task exit code -1. When trying to kill a hidden window you must use kill process. |