Click on a script parameter to view its definition:

IF Definitions

Application is Running
Test to see if the specified application is running.
Check Registry Value
Evaluate the given Registry Value.
Check Variable
Evaluate the given Agent Variable.
Test File
Test for the existence of a file.
Test File in Directory Path
Test for the existence of a file in the current Directory Path.
Test Registry Key
Test for the existence of the given Registry Key.
True
Always returns True, executing THEN branch.
User Is Logged In
Tests whether a specific user (or any user) is logged in or not.
User Response is Yes
Presents a Yes/No dialog box to the user.

THEN/ELSE Definitions

Close Application
Close a running application.
Delete File
Delete a file from the remote machine.
Delete File in Directory Path
Delete file in directory returned by Get Directory Path From Registry.
Delete Registry Key
Delete the key from the registry.
Delete Registry Value
Delete the value from the registry.
Execute File
Execute any file as if it was run from the Run item in the Windows Start menu.
Execute File in Directory Path
Same as execute file. File location is relative to the directory returned by Get Directory Path From Registry.
Execute Script
Start another VSA script.
Execute Shell Command
Run any command from a command shell.
Get Directory Path From Registry
Returns the directory path stored in the registry at the specified location.
Get File
Get a file from the remote machine and save it to the VSA server.
Get File in Directory Path
Get a file from the remote machine located relative to the directory returned by Get Directory Path From Registry and save it to the VSA server.
Get Variable
Get a value from the agent on the remote machine and assign it to a variable
Impersonate User
Use the specified credential to execute a file or shell when Execute as user specified.
Pause Script
Pause the script for N seconds.
Reboot
Reboot the remote machine.
Rename Locked File
Renames a file that is currently in use.
Rename Locked File in Directory Path
Renames a file in directory returned by Get Directory Path From Registry that is currently in use.
Send Message
Display a message in a dialog box on the remote machine.
Send a URL
Open a browser to the specified URL on the remote machine.
Set Registry Value
Set the registry value to a specific value.
Use Credential
Use the user login credentials set for the machine ID in Set Credential to execute a file or shell when Execute as user specified.
Write File
Write a file stored on the VSA to the remote machine.
Write File in Directory Path
Write a file stored on the VSA to the remote machine at into the directory returned by Get Directory Path From Registry.
Write Script Log Entry
Write a string to the Script Log.
IF Definitions

Application is Running

Checks to see if a specified application is currently running on the client machine. If the application is running, the THEN statement is executed; otherwise, the ELSE statement is executed. When this option is selected from the dropdown list, the "Enter the application name" field appears.

Check Registry Value

After entering the registry path, the value contained in the key is returned. A check can be made for existence, absence, equality, or size differences. For example, HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\AppPaths\AgentMon.exe\path contains the directory path identifying where the Agent is installed on the target machine. The test determines if the value stored at the key exists, thereby verifying the Agent is installed.

Note: a backslash character \ at the end of the key returns the default value that key. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WORDPAD.EXE\ will return the default value something like %ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE

The available tests are:

Check Variable

Enter an Agent Variable name, in the form #var_name#, in the space provided. Check Variable evaluates the current values assigned the #var_name# and compares it with the supplied value.  The supplied value may also be another Variable name in the form of #var_name#.  If the check is true, THEN steps are executed. If the check is false, ELSE steps are executed.The available tests are:

For the tests =, Not =, >, >=, <, and <= the variables compared may be a string, a number, a date in the format of yyyy/mm/dd or yyyy/mm/dd hh:mm or yyyy/mm/dd hh:mm:ss, or a version number containing dots or commas such as 1.2.3 or 4,5,6,7.

Test File

Determines if a file exists on a remote machine. Enter the full path and filename. For example, entering c:\windows\notepad.exe returns True if Notepad.exe exists, False if it does not.

Back to Top

Note: Environment variables such as %windir%\notepad.exe are acceptable.

Test File in Directory Path

Enter the name of a file to see if it exists on the remote machine. Because a THEN or ELSE step must be executed prior to this IF test, Test File in Directory Path is only useful for scripts that are executed by THEN or ELSE steps.

Test Registry Key

Tests for the existence of a registry key. Test Registry Key differs from Check Registry Value since it can check for a directory level registry entry that only contains more registry keys (no values). Test Registry Key detects if an entire registry branch exists.

True

Selecting True directs the THEN steps to execute. Use True to directly execute a series of steps that do not require any decision points, such as Does a file already exist?

User Is Logged In

Tests to see if a specific user or any user is logged in on the remote machine.  Enter the user's login name or leave the field blank to check for any user logged in.  The THEN steps are executed if a user is logged in. The ELSE steps are executed if the user is not logged in.

User Response is Yes

Displays a dialog box on the remote machine with a Yes and No button. Also carries out the ELSE command if an administrator-configured specified amount of time has elapsed (timeout). If Yes is selected, the THEN function is executed. If the selection times out or the user selects No,  the ELSE function is executed. This function requests the user's permission to proceed with the script. This query is useful for scripts that require a reboot of the remote machine before completion.

Each script consists of a simple IF-THEN-ELSE clause. IF tests for something on a remote machine. If the test passes, (was true, the file exists, etc.) the statements in the THEN section are executed. If the test fails, the statements in the ELSE section are executed. Refer to the section below to create/edit a script with IF-THEN-ELSE clauses.

Note: Script variables (#varName#) may be used inside the User Response is Yes fields to dynamically generate messages based on script data.

Back to Top

Note: The /qn parameter passed with setup.exe commands Microsoft install files to install quietly without prompting the user for any information. If a product key is required, the program asks for it on first use. This option allows installation of programs to all machines in parallel without any per-machine interaction.

THEN/ELSE Definitions

Operating System Detect

When writing a THEN/ELSE function,  you can select on which operating system the function will execute. This function is useful when you want to write one script that needs to be executed on different operating systems. For example, directory paths in Windows 95 and Windows NT can differ; create two separate script steps and label them Windows 95 and Windows NT, respectively.

Close Application

If the specified application is running on the remote machine, then that application is closed down.

Delete File

Deletes a file on a remote machine. Enter the full path and filename.

Note: Environment variables are acceptable if they are set on a user's machine.  For example, using a path %windir%\notepad.exe would be similar to C:\windows\notepad.exe.

Back to Top

Delete File in Directory Path

Deletes the specified file located at the path returned from a Get Directory Path From Registry call.

Delete Registry Value

Delete the value stored at the specified registry key.

Delete Registry Key

Delete the specified registry key and all its sub-keys.

Execute File

Executes the specified file on the remote machine. This function replicates launching an application from the Run… command located in the Microsoft Windows Start menu. This function takes three parameters:

  1. Full path filename to the .exe file.

  2. Argument list to path to the .exe file

  3. Flag indicating whether the script should wait until the .exe completes or not. (1 to wait, 0 to have the script continue without waiting).Note: Environment variables are acceptable, if they are set on a user's machine.  For example, using a path %windir%\notepad.exe, would be similar to C:\windows\notepad.exe.

Execute File in Directory Path

Same as Execute File except the location of the .exe file is located at the path returned from a Get Directory Path From Registry call.

Note: Environment variables are acceptable if they are set on a user's machine.  For example, using a path %windir%\notepad.exe would be similar to C:\windows\notepad.exe.

Back to Top

Execute Script

Causes another named script to execute. Use this capability to string multiple IF-THEN-ELSE clauses together. If the script no longer exists on the server, an error message will appear next to the script dropdown list.

Execute Shell Command

Allows the script to pass commands to the command interpreter on the client machine. When this command is selected, the field Enter the command to execute in a command prompt is displayed. Enter a command in the field. The command must be syntactically correct and executable with the OS version on the client machine. Commands and parameters containing spaces should be surrounded by quotes. Since the command is executed relative to the Agent directory, absolute paths should be used when entering commands.

Note: Execute Shell Command opens a Command Prompt window on the remote machine to execute in. If you do not want a window opening on the remote machine (it may confuse uses), put all the commands into a batch file. Send that file to the remote machine (using Write File). Then run the batch file with the Execute File command. Execute File does not open a window on the remote machine.

Get Directory Path From Registry

Returns a file path stored in the specified registry key. Use this command to fetch file location. For instance, use this command to find the directory where an application has been installed.

Back to Top

Get File

Upload the file at the specified path from the remote machine. Be sure to enter a full path filename (including the filename) that you want the file to upload. The file is stored on the VSA in a private directory for each remote machine. Access the uploaded file from the Get File function under the Configure Tab.

As an option, existing copies of uploaded files will be renamed with a .bak extension prior to the next upload of the file. This allows you to examine both the latest version of the file and the previous version.

Also as an option, an email alert can be sent when a change in the uploaded file has been detected (compared to the last time the same file was uploaded).

Get File in Directory Path

Just like Get File but it adds the path returned from a Get Directory Path From Registry call to the beginning of the remote file path. Access the uploaded file from the Get File function under the Configure Tab.

Back to Top

Get Variable

Defines a new Agent variable. When the script step executes, the system defines a new variable and assigns it a value based on data fetched from the remote machine's agent. You can refer to this value in an subsequent script line (or subsequent script) by adding # around the variable name. e.g. #var_name#

Impersonate User

Use the specified credential to execute a file or shell when Execute as user specified. Enter a username, password, and domain for the agent to log in with. Leave domain blank to log into an account on the local machine.

Pause Script

Pause the script for N seconds. Use this command to give Windows time to complete an asynchronous task, like starting or stopping a service.

Reboot

Unconditionally reboots the remote machine. To warn the user first, preface this command with a User Response is Yes message.  A User Response is Yes message will prompt the user before rebooting their machine.

Rename Locked File

Renames a file that is currently in use. The file is renamed the next time the system is rebooted. The specified filename is a complete file path name. Rename locked file can also be used to delete a file that is currently in use if the destination is empty. The file is deleted when the system is rebooted.

Back to Top

Rename Locked File in Directory Path 

Renames a file that is currently in use. The file is renamed the next time the system is rebooted. The specified file name is appended to the directory path. Rename locked file in directory path can also be used to delete a file that is currently in use if the destination is empty. The file is deleted when the system is rebooted.

Send Message

Sends the entered message to a remote machine. Selecting Immediately will display a message dialog box immediately. Selecting After user clicks the flashing system tray icon flashes the Agent system tray icon when a message is received. The message is displayed when the user clicks the icon.

Send a URL

Sends the entered URL to a remote machine. Selecting Immediately launches the default Web browser and the specified URL is displayed. Selecting After user clicks the flashing system tray icon flashes the Agent system tray icon when a message is received. The URL is displayed in the default Web browser when the user clicks the icon.

Back to Top

Set Registry Value

Writes data to the specified registry key. This function takes three parameters:

  1. Registry key path

  2. Data to write to the registry key

  3. Data type of the registry key (String Value, DWORD Value, Binary Value).

Use Credential

Use the user login credentials set for the machine ID in Set Credential to execute a file or shell when Execute as user specified.

Write File

Writes a new file to the remote machine at the specified path and filename. Be sure to enter a full path filename (including the filename) that you want the file to be named. The source file is pulled from the server from the drop down control. To add more files to the server, click Manage Files…

Each time a script executes the "Write File" command, the agent checks to see if the file is already there or not (hashes the file to verify integrity). If not, the file is written. If the file is already there, the script moves to the next step. You can repeatedly run a script with Write File that sends a large file to a remote machine and know that the VSA will only download that file once.

Note: Environment variables are acceptable if they are set on a user's machine. For example, using the path %windir%\notepad.exe would be equivalent to C:\windows\notepad.exe.

Write File in Directory Path

Writes the specified filename to the path returned from a Get Directory Path From Registry call.

Write Script Log Entry

Writes the supplied string to the script log for the agent executing this script.

Back to Top