Getting started - Hidden Command

Using Hidden Command

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 this Command Prompt with the Hidden Command toolbar option.

image

Double click or drag and drop to use the hidden command from the toolbar menu

image
Enter the command, or start a program with arguments.Yarado variables are available everywhere the users can type text, including the Enter Command textbox. When spaces are involved, it’s better to add quotes around the command and or its parameters.

Hit the test button to test the outcome of the command entered.

The command-line inherits privileges from the Yarado Client, meaning that if the Yarado Client is running as administrator, so is the command line.

Enter Command: the command line, including parameter(s).

Do not hide command window: shows the command window, visible for the logged-on user.
image
Wait for process to finish: Yarado waits for the command to finish, or until the Max Runtime threshold is reached.

Timeout : The number of seconds that the command is allowed before being classified as unresponsive. Unresponsiveness can occur 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 process will be forcefully killed. To prevent this from happening, users can set an extra grace period.

Create Command log: If enabled, this creates a logfile per command step for later governance/debugging. This log is available at the following path:%appdata%\Yarado\logs\timestamp-of-step.

image

Output back to variable: Any text that will be displayed in the console is fetched and copied into the selected Yarado variable. Use the dropdown arrow to select the desired variable. ** 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.

Exercise 1: Start Notepad and kill command-line after 10 seconds

image

1: Enter notepad.exe

2: Select Do not hide command window

3: Select Wait for process to finish

4: Click Ok
image
5: Click Start

The result should be a command window that is alive for 10 seconds, after that the command
window should get killed.

Exercise 2: Get list of files in the Windows directory

Create a new Yarado file by clicking on File - > New in the top left corner.
image

Click on variable name and enter List

Double click or drag and drop to use the Hidden Command from the toolbar menu.
image

Command dir /b %systemroot%*.*
image

  • Dir : Displays a list of files and subdirectories in a directory
  • /b : Uses bare format (no heading information or summary)
  • %systemroot% : System variable that refers to the location of the where the system is
    installed (mostly C:\Windows)
  • . : Wildcards, any file or directory
  • Output to variable : Select %list% form the list
  • Click OK

image
Click Start

image
Double click the list value to display the result.

image

Click Cancel

Exercise 3: Run a script and get result

Click File --> New within Yarado client

Open a new notepad file
image

Type @echo Hello World

Click File --> Save

image

Type Filename C:\Temp\script.cmd
image

Make Sure extension is .cmd, and All Files is set to (.)

Click Save
image

If you get this message, Try C:\tmp, or else create a personal directory and note it down for later use.

image
Create a variable ScriptRes

Double click or drag and drop to use the Hidden Command from the toolbar menu.

image

Command : The location of the script or program

image

C:\Temp or c:\tmp, If any own create path is used enter the path. ** when spaces exist in the path
use quotes around them e.g. “c:\temp\Hello world.cmd”

Wait for process to finish : Make sure this is checked

Output to variable : Set output to variable %scriptRes%

Click OK

References

Click on the references to get more information about the windows command prompt and how to
use it

1 Like