Run Shell Command
ActionStep Reference » Windows » Operating System » General » Run Shell Command
The ActionStep Run Shell Command executes Win32 console commands to automate routine tasks done in a Windows environment.
- Open the Windows node in the Workspace Explorer.
- Open the Operating System node.
- In the General node, select the Run Shell Command ActionStep.
Parameters:
The ActionStep has the following input parameters:
name |
Description
|
---|---|
Command
|
The shell command to be executed with Windows command line interpreter 'cmd.exe'.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Wait For Exit
|
Determines if the ActionStep should wait until the command has been executed.
Allowed Context Scope [Fixed] Allowed Value [Boolean] |
Setting the Boolean value to "True" for the Wait For Exit parameter displays the result in Output of the Result List. |
Results:
The ActionStep returns the following results:
name
|
description
|
---|---|
Output
|
The output of the command line interpreter.
Parameter of the "Line" sub-branch:
Allowed Context Types [Variable, Parameter] |
Handle
|
The process handle of the command line interpreter.
Allowed Context Scope [Fixed] Allowed Context Types [Variable, Parameter] |
Exit Code
|
A numeric value as exit code of the executed command.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter] |
Editing the registry may severely damage your system if done incorrectly. To avoid data loss on the computer when making changes to the registry, make sure to back up any important data on the computer. |
Example 1 (Run the traceroute command for a URL):
This example creates two local variables, ShellCommand and URL with Text, as data type. The variables are then concatenated to create the shell command and execute the "tracert" command. A notice is then output when the traceroute is complete in Speech Output.
Example 2 (Search a string in a text file with a shell command):
This example creates two local variables, ShellCommand and StringValue, with Text as data type. If the specified text file exists in a directory, the "findstr" inline command is created by concatenating the value of the variables and the path name of the text file. Then, the result of the string search within the text file is displayed in Message Box.
See other OS General operations:
Get Environment Information
Empty Recycle Bin
Lock Screen
System Shutdown