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. |
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.
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:
Exists : true if the registry key exists in the hive
Absent : true if the registry key does not exist in the hive
= : true if value of the registry key equals the test value
Not = : true if value of the registry key does not equal the test value
> : true if value of the registry key is greater than the test value (value must be a number)
>= : true if value of the registry key is greater than or equal to the test value (value must be a number)
< : true if value of the registry key is less than the test value (value must be a number)
<= : true if value of the registry key is less than or equal to the test value (value must be a number)
Contains : true if the test value is a sub string of the registry key value (value must be a string)
Not Contains : true if the test value is not a sub string of the registry key value (value must be a string)
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:
Exists : true if the variable exists
Absent : true if the variable does not exist
= : true if value of the variable equals the test value
Not = : true if value of the variable does not equal the test value
> : true if value of the variable is greater than the test value
>= : true if value of the variable is greater than or equal to the test value
< : true if value of the variable is less than the test value
<= : true if value of the variable is less than or equal to the test value
Contains : true if the test value is a sub string of the variable (variable must be a string)
Not Contains : true if the test value is not a sub string of the variable (variable must be a string)
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.
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.
Note: Environment variables such as %windir%\notepad.exe are acceptable.
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.
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.
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?
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.
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.
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.
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.
If the specified application is running on the remote machine, then that application is closed down.
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.
Deletes the specified file located at the path returned from a Get Directory Path From Registry call.
Delete the value stored at the specified registry key.
Delete the specified registry key and all its sub-keys.
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:
Full path filename to the .exe file.
Argument list to path to the .exe file
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.
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.
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.
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).
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.
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#
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 the script for N seconds. Use this command to give Windows time to complete an asynchronous task, like starting or stopping a service.
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.
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.
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.
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.
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.
Writes data to the specified registry key. This function takes three parameters:
Registry key path
Data to write to the registry key
Data type of the registry key (String Value, DWORD Value, Binary Value).
Use the user login credentials set for the machine ID in Set Credential to execute a file or shell when Execute as user specified.
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.
Writes the specified filename to the path returned from a Get Directory Path From Registry call.
Writes the supplied string to the script log for the agent executing this script.