Use variables to store values that can be referenced in multiple procedure steps. Variables are passed automatically to nested procedures.
VariableName
. In subsequent steps, including steps in nested procedures, reference the variable by bracketing the variable name with the #
character. Example: #VariableName#
. Note: Procedures variables cannot be referenced outside of the procedure or nested procedures that use them except for GLOBAL variables. A procedure variable is only visible to the section of the procedure it was created in and any child procedures. Once a procedure leaves the THEN clause or ELSE clause the variable was created in, the variable is out of scope and no longer valid. Use GLOBAL Variables, described below, to maintain visibility of a variable after leaving the THEN clause or ELSE clause the variable was created in.
<
and >
character. Example: <VariableName>
.GLOBAL:
(case-insensitive followed by a colon) can pass changed values from the child to the parent, whether the variable is initialized in the parent or the child procedure. Subsequent child procedures can makes use of any GLOBAL variable initialized in any earlier step, regardless of whether that global variable is initialized in a parent procedure or another child procedure., % ' " / \ : * ? < > |
and the space character.<
, >
and #
characters are used to identify variable names, these characters must be entered twice as regular text in a command line. For example the following command c:\dir >> filelist.txt
is interpreted at procedure runtime as c:\dir > filelist.txt
.HKEY_LOCAL_MACHINE\SOFTWARE\SomeKey\Value\\Name
is interpreted as the key HKEY_LOCAL_MACHINE\SOFTWARE\SomeKey
with a value of Value\Name
. c:\
.Warning: Do not delete files and folders in the working directory. The agent uses the data stored in the working directory to perform various tasks.
%TEMP%
environment variable for the currently logged on user. If no user is logged on, it is the default Windows temporary directory.exe
or dll
file often contain the version number of their release.yyyy/mm/dd hh:mm:ss
.#SqlViewName.ColumnName#
in a procedure to return the value of a dbo.SqlView.Column for the agent running the agent procedure. See System > Database Views for a list of the SQL views and columns that are available.Note: SQL View Data - This older method of returning a database view value is only necessary if you are trying to return a value from a different machine than the machine running the agent procedure. Use the GetVariable command with the SQL View Data option to create a new procedure variable and set it to the value of a dbo.SqlView.Column value. Use the format SqlViewName/ColumnName/mach.groupID
or SqlViewName/ColumnName
. If the optional machine ID is omitted, then the value for the agent executing the procedure is retrieved. If ColumnName
contains a space, surround it with square brackets. Example: vSystemInfo/[Product Name]
. See System > Database Views for a list of the SQL views and columns that are available.
#adminDefaults.adminEmail#
- Email address of the VSA user who scheduled the agent procedure.#adminDefaults.adminName#
- Name of the VSA user who scheduled the agent procedure.#scriptIdTab.scriptName#
- Name of the agent procedure.NameSpace:Class.Property
. For example, root\cimv2:Win32_OperatingSystem.FreePhysicalMemory
. Specify an instance using the following syntax: NameSpace:Class[N].Property
where [N]
is the instance number. For example, root\cimv2:Win32_OnboardDevice[3].Description
. The first instance may be specified with or without specifying the [1]
instance number.+
, -
, *
, /
, (
, and )
that are evaluated and assigned to a new procedure variable. For example, ((#variable1# + #variable2#) + 17.4) / (#variable3# * 4)
. The procedure variables must contain numeric values.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
.