ArrayCopy
ArrayCopy>array_name,[suffixformat],new_array
Creates a copy of an array.
Suffixformat is used to specify the format used for the array suffix as array variables in script can take any format so desired. If omitted suffixformat is set to "_n" where n is the numeric placeholder. This would match an array with the format array_1, array_2, etc. An array format that looks like array[1], array[2] ... array[n] has the suffix format "[n]" (without the quotes)
ArrayCopy works with numeric array indexes only. Only arrays starting at index 0 or 1 will be recognised.
Abbreviation: ACP
ArrayCopy Example
GetFileList>%SCRIPT_DIR%\*.*,MyFiles
Separate>MyFiles,;,FilesArray
ArrayCopy>FilesArray,,NewArray
ArrayRename
ArrayRename>array_name,[suffixformat],new_array
Renames an array.
Suffixformat is used to specify the format used for the array suffix as array variables in script can take any format so desired. If omitted suffixformat is set to "_n" where n is the numeric placeholder. This would match an array with the format array_1, array_2, etc. An array format that looks like array[1], array[2] ... array[n] has the suffix format "[n]" (without the quotes)
ArrayRename works with numeric array indexes only. Only arrays starting at index 0 or 1 will be recognised.
Abbreviation: ARN
ArrayRename Example
GetFileList>%SCRIPT_DIR%\*.*,MyFiles
Separate>MyFiles,;,FilesArray
ArrayRename>FilesArray,,NewArray
ArrayCount
ArrayCount>array_name,result[,suffixformat]
Returns in result the number of items in a simple one dimensional array.
Suffixformat is used to specify the format used for the array suffix as array variables in script can take any format so desired. If omitted suffixformat is set to "_n" where n is the numeric placeholder. This would match an array with the format array_1, array_2, etc. An array format that looks like array[1], array[2] ... array[n] has the suffix format "[n]" (without the quotes)
ArrayCount works with numeric array indexes only. Only arrays starting at index 0 or 1 will be recognised. ArrayCount assumes that the array index advances by 1 for each element. If there are any gaps ArrayCount will stop at the last element before the gap.
Abbreviation: ARC
ArrayCount Example
GetFileList>%SCRIPT_DIR%\*.*,MyFiles
Separate>MyFiles,;,FilesArray
ArrayCount>FilesArray,numItems
ArrayDim
ArrayDim>array_name,num_elements
Creates an empty array with specified number of elements. If the array already exists and num_elements is larger than the existing number of elements the array is lengthened with extra empty elements.
Abbreviation: ARR
ArrayDim Example
ArrayDim>Names,3
Let>Names_1=Fred
Let>Names_2=Sally
Let>Names_3=John
ArraySort
ArraySort>array_name,[,suffixformat]
Sorts the given array in ascending alphanumeric order.
Suffixformat is used to specify the format used for the array suffix as array variables in script can take any format so desired. If omitted suffixformat is set to "_n" where n is the numeric placeholder. This would match an array with the format array_1, array_2, etc. An array format that looks like array[1], array[2] ... array[n] has the suffix format "[n]" (without the quotes).
ArraySort works with numeric array indexes only. Only arrays starting at index 0 or 1 will be recognised. ArraySort assumes that the array index advances by 1 for each element. If there are any gaps ArraySort will stop at the last element before the gap.
Abbreviation: ARS
ArraySort Example
GetFileList>%SCRIPT_DIR%\*.*,MyFiles
Separate>MyFiles,;,FilesArray
ArraySort>FilesArray
DelArray
DelArray>array_name,[,suffixformat]
Deletes the specified array. Deleting an array removes all array element variables from the variable table such that they are no longer available for use.
DelArray Example
DelArray>Names
DelVariable
DelVariable>Variable_Name
Deletes the specified variable from the variable table. Once deleted a variable will no longer be available and any reference to it will yield the literal string instead.
DelVariable Example
DelVariable>x
GetEnvVar
GetEnvVar>EnvironmentVariable,LocalVariable
Retrieves the value of the specified environment variable into the local variable given in LocalVariable.
Abbreviation: GEV
Get EnvVar Example
GetEnvVar>TMP,myTMPDir MessageModal>myTMPDir
KillProcess
KillProcess>process
Terminates the given process. Process can be a module name (e.g. notepad.exe) or a numeric process ID.
Abbreviation: Kil
KillProcess Example
ProcessExists>notepad.exe,bNotepadExists
If>bNotepadExists=True
KillProcess>notepad.exe
Endif
Random
Random>Range,Result
Returns a random number within the specified range where 0 <= Result < Range.
The seed is set automatically and is stored in the RND_SEED variable. It is possible to set the seed programmatically by modifying the value of RND_SEED.
Result is a variable in which the result is stored.
Abbreviation: RAN
Random Example
Random>6,DiceResult
Let>DiceResult=DiceResult+1
Message>You threw a %DiceResult%
SetEnvVar
SetEnvVar>EnvironmentVariable,Value
Sets the value of the specified environment variable with Value.
Abbreviation: SEV
SetEnvVar Example
SetEnvVar>name,fred
WaitCursorChanged
WaitCursorChanged>Timeout
This command causes script to wait until the cursor of the foreground window changes. If it doesn't change within the number of seconds specified in Timout, the command stops waiting and the variable WCC_RESULT is set to FALSE. WCC_RESULT is TRUE if the command terminated because the foreground window cursor changed within the specified time. if Timeout is set to 0, the command will wait indefinitely.
This command is useful for waiting for applications to become idle. For example, it can be used after initiating some operation in an application that invokes the hourglass cursor, so that you can wait for the application to become idle again.
Abbreviation: WCC
WaitCursorChanged Example
Change Directory>c:\program files\agent\data
Run Program>"c:\program files\agent\agent.exe"
WaitCursorChanged>500
SetFocus>Agent*
ProcessExists
ProcessExists>processname,result
Sets result to True if processname exists, False if not.
Abbreviation: Pro
ProcessExists Example
ProcessExists>notepad.exe,bNotepadExists
If>bNotepadExists=False
Run>notepad.exe
Endif
WaitProcessExists
WaitProcessExists>processname
Waits for the specified process name to exist.
The system variable WFP_TIMEOUT can be used to set the number of seconds after which this command should timeout. If set to zero (the default) the timeout will not occur and the command will continue indefinitely. If WFP_TIMEOUT is used, WFP_RESULT will indicate whether or not the command ended successfully. If it timed out WFP_RESULT will be set to FALSE. If the process it was waiting for came into existance within the timeout setting, the WFP_RESULT value will be set to TRUE.
Abbreviation: WPE
WaitProcessExists Example
WaitProcessExists>notepad.exe
MessageModal>Notepad now exists
WaitProcessTerminated
WaitProcessTerminated>processname
Waits for the specified process name to not exist.
The system variable WFP_TIMEOUT can be used to set the number of seconds after which this command should timeout. If set to zero (the default) the timeout will not occur and the command will continue indefinitely. If WFP_TIMEOUT is used, WFP_RESULT will indicate whether or not the command ended successfully. If it timed out WFP_RESULT will be set to FALSE. If the process it was waiting for terminated within the timeout setting, the WFP_RESULT value will be set to TRUE.
Abbreviation: WPT
WaitProcessTerminated Example
WaitWindowClosed>notepad*
WaitProcessTerminated>notepad.exe
MessageModal>Notepad has left the building!
Wow64DisableRedirection
Wow64DisableRedirection
Disables 64 bit file system redirection.
On 64 bit versions of Windows the Windows\System32 folder is reserved for 64 bit applications. 32 bit versions of DLLs and applications are stored in Windows\SysWOW64. By default when a 32 bit process such as desktop client attempts to access a system resource it will be automatically redirected to the SysWOW64 folder to load the 32 bit resource. Even though you may explicitly declare "C:\Windows\System32" in a file operation the operating system will divert the call to the SysWow64 folder.
Usually this is desirable (32 bit processes cannot load 64 bit DLLs) and there are 32 bit equivalents for almost all system functions.
However there may be occasions where a 32 bit equivalent does not exist and you explicitly want to execute a 64 bit system process. So you may want to disable 64 bit file system redirection. You can do this with the Wow64DisableRedirection command. But use it carefully and be sure to re-enable redirection immediately afterwards. Failing to do that could cause instability as it may prevent desktop client from loading a system DLL and therefore cause loss of functionality.
For more information refer to the Microsoft documentation at: http://msdn.microsoft.com/en-us/library/aa384187(v=vs.85).aspx
A safer way to force access to the System32 folder is to refer to the SYS_NATIVE variable. E.g. the following will run the 64 bit version of Notepad:
Run>%SYS_NATIVE%\Notepad.exe
Using SYS_NATIVE is the safest way to bypass file system redirection.
Wow64EnableRedirection
Wow64EnableRedirection
Re-enables 64 bit file system redirection.
Comments
0 comments
Please sign in to leave a comment.