Windows Command Prompt is a command-line interpreter application available in most Windows operating systems and used to execute entered commands. Most of those commands automate tasks via scripts and batch files, perform advanced administrative functions, and troubleshoot or solve certain kinds of Windows issues.
Yarado has support for Windows Command Prompt with the Hidden Command option in the toolbar menu.
Double click the icon or drag it to the process visuliser to use the hidden command function.
Using Hidden Command
The Hidden Command step is a step that must be created manually because it is not possible to provide the required information when you are using the recording mode.
The command-line inherits privileges from the Yarado Client, meaning that if the Yarado Client is running as administrator, so is the command line.
Yarado variables are available everywhere users can type text, including the Enter Command textbox. When spaces are involved, it's better to add quotes around the command or its parameters.
Enter the command, or start a program with arguments.
|Enter Command||The command line where you can enter you commands, including parameter(s).|
|Test||The test button allows you to test your command quickly before saving the step, allowing for easy changes if necessary.|
|Do not hide command window||Choose whether or not to show the command window to the logged-on user while this step is running.|
|Wait for process to finish||If checked, Yarado waits for the command to finish, or until the Max Runtime threshold is reached.|
|Output to variable||Any text that gets displayed in the console is fetched and transferred to the selected Yarado variable. Use the dropdown arrow to select the desired variable. Manually entering a **variable that does not exist yet will not result in the creation of a new variable.|
|Timeout||The number of seconds that the command is allowed to run before being classified as unresponsive. Unresponsiveness can occur, for example, when the system becomes extremely busy. **However, unresponsiveness for an extended period indicates failure. The default of 10 seconds should be fine for most scenarios.|
|Max Runtime||The max amount of time in seconds a command-line process is allowed to run. If the command-line running time exceeds the runtime threshold, the command-line process gets forcefully **killed. To prevent this from happening, you can set an extra grace period.|
|Create Command log||If enabled, this creates a logfile per command step for later governance or debugging. This log is available at:
When returning any characters that are not ANSI, they might be displayed incorrectly in the variable. To workaround, export the output to a file and use a load from file Yarado function.
Get a list of files in the Windows directory
For this example, we will use a Hidden Command step to create a list of all the files in the Windows system directory.
Create a variable named
Double click the icon or drag & drop it to the process visuliser to use the Hidden Command function.
Create a Hidden Command step.
Enter the command in the Enter Command text box:
dir /b %systemroot%\*.*
This command consists of the following elements:
Dir- Displays a list of files and subdirectories in a directory
/b- Uses bare format (no heading information or summary)
%systemroot%- Is a system variable that refers to the location of the where the system is installed (usualy C:\Windows)
*.*- Wildcards, any file or directory
For the output to variable, select
%list%form the dropdown.
Settings for this command step.
Click OK to save and close the window.
Click start to run run your command.
Double click the Variable Value of the
%list%variable to display the result.
Your output is listed in the variable text edit window.