Process - Execute

Top  Previous  Next

This is the Add/Edit task -> Execute tab.

 

clip0020

 

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:

"Network credentials only" - Log on, but use the specified credentials on the network only. The new process uses the same token as the caller, but the system creates a new logon session within LSA, and the process uses the specified credentials as the default credentials.  This value can be used to create a process that uses a different set of credentials locally than it does remotely. This is useful in inter-domain scenarios where there is no trust relationship. The system does not validate the specified credentials. Therefore, the process can start, but it may not have access to network resources. If you just want to access a network drive then you should specify the username, password and domain of the remote computer and use it with option "Network credentials only". To access network resources (from a local account) you have to use logon type: "With Profile". When you can - use "Network credentials only" as it is faster and takes less system resources. You must specify the UNC path. For example, you can't use the drive letter "Y:\yourfile.bat", you must use the path "\\server\folder\yourfile.bat".
"Logon With Profile" - Log on, then load the user profile in the "HKEY_USERS" registry key. The function returns after the profile is loaded. Loading the profile can be time-consuming, so it is best to use this value only if you must access the information in the "HKEY_CURRENT_USER" registry key or you have to access network resources. Windows Server 2003 and Windows 2000: The profile is unloaded after the new process is terminated, whether or not it has created child processes. Windows XP: The profile is unloaded after the new process and all child processes it has created are terminated.

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:

Idle - Indicates a process whose threads run only when the system is idle and is preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle priority class is inherited by child processes.
Below Normal - Indicates a process that has priority higher than Idle but lower than Normal.
Normal - Default value, indicates a normal process with no special scheduling needs.
Above Normal - Indicates a process that has priority higher than Normal but lower than High.
High - Indicates a process that performs time-critical tasks that must be executed immediately for it to run correctly. The threads of a high-priority class process preempt the threads of normal or idle priority class processes. An example is the Task List, which must respond quickly when called by the user, regardless of the load on the operating system. Use extreme care when using the high-priority class, because a high-priority class CPU-bound application can use nearly all available cycles.
RealTime - Indicates a process that has the highest possible priority. The threads of a real-time priority class process preempt the threads of all other processes, including operating system processes performing important tasks. For example, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive.

 

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-dots­button" 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.