This topic may not be the most popular one among software testers. Nevertheless, if you are working with desktop applications, knowledge of the capabilities of the Windows console is a must. Moreover, this article may be of use for those who want to become confident Windows users. So make yourself comfortable and prepare to make notes. We’ll be sharing some of the helpful commands.
What Is the Command Line?
We’ll start with the information for newbies – what the command line is and for what you can use it.
The command line is a program that allows a user to communicate directly with the operating system. The command line has a text-based user interface, where all applications and programs are controlled by writing text commands.
How to Run the Command Line?
To run the command line, you can use one of the following methods:
- Press Start → Run or Win + R → enter cmd → press Enter.
- Press Start → All Programs → Accessories → Command Line.
- Press Start → Search → Command Line.
How to Enter Commands?
To enter commands, use keyboard input. For example, if you enter help, you’ll receive information about all the available command options.
If you want to enter the path to a file manually, use the Tab key. Press it after entering the first letter of the folder you are looking for, and the system will autocomplete the path, letting you access a directory or a file in a few seconds.
To copy the text from the command line, you need to configure it in the settings. Copying is disabled by default. To change this, you need to do the following:
- Right-click on the command line window title and select Properties.
- Check Select with the mouse and Quick insert.
To copy a text from the command line to the clipboard, highlight this text and right-click. Right-clicking is also used to paste a text into the command line.
Commands in Windows
Now, we’ll share the list of frequently used commands that may be helpful for you during testing. Keep in mind that it is only a short list of commands. There are many more of them in the whole set.
The commands are arranged in alphabetical order. Each comes with a brief description telling about its purpose – in other words, what you can do using this particular combination of letters.
A
- ARP – ARP tables viewing and modifying (ARP stands for Address Resolution Protocol).
- ASSOC – viewing or modifying the file extension associations for applications.
- AT – task scheduler management.
- ATTRIB – file attributes changing.
- Auditpol – audit policies management.
B
- BASH – BASH shell for the Windows Subsystem for Linux (WSL).
- BCDBOOT – copying the boot files to the system partition and creating a new boot configuration store (BCD).
- BOOTSECT – boot sector editing to ensure NTLDR or BOOTMGR.
- BREAK – enabling or disabling of the CTRL + C combination processing in DOS.
C
- CACLS – file access control list editing (ACL is short for Access Control List).
- CHGUSR – changing of the terminal server settings, similar to CHANGE USER.
- CHCP – viewing or changing of the current code page.
- CHKDSK – disk check.
- CLS – command line screen clearing.
- CMD – starting a new copy of the command line interpreter.
- CMDKEY – username and password management (creating, displaying, deleting, and saving).
- COLOR – changing text and background colors in the CMD window.
D
- DevCon – command line device management.
- DIANTZ – the same as MAKECAB, which is .cab archive creation.
- DIR – displaying a list of files and directories.
- DISKCOMP – comparing the contents of two floppy disks.
E
- EXIT – exiting a procedure or batch file.
- EXPAND – compressed CAB files unpacking.
- EXTRACT – content extraction, unpacking of the CAB files in Windows (EXTRAC32).
F
- FC – file content comparison.
- FIND – searching for a character string in a file.
- FINDSTR – searching for the strings in files using regular expressions.
M
- MAKECAB – compressed CAB file creation.
- MBR2GPT – conversion of MBR disks to GPT.
- MEM – requesting information about memory usage in MS-DOS.
- MD – creation of a new directory.
- MKLINK – creation of a symbolic link to a file or directory.
- MODE – system device configuration in the CMD environment.
- MORE – paginated console output.
P
- PROMPT – changing the prompt line in the console.
- PUSHD – saving of the current directory path and going to the specified directory.
- PSR – Problem Steps Recorder.
Q
- QPROCESS – process status display.
- QUERY – displays information about the status of processes and user sessions.
- QUSER – displays information about user sessions.
S
- SCHTASKS – task scheduler management.
- SCLIST – displaying a list of system services.
- SET – displaying and changing Windows environment variables.
- SETLOCAL – local variables settings in a batch file.
- SETX – utility for creating system variables.
- SFC – Windows system file checking and restoring.
W
- WHOAMI – displaying the current user’s name.
- WINDIFF – file content comparison.
- WinMgmt – WMI service starting (Windows Management Instrumentation).
- WINRM – Windows Remote Management via the command line.
- WINSAT – Windows Performance Checker.
- WMIC – execution of the WMI command in the command line.
- WSCollect – access to the CAB file with copies of Windows 10 desktop logs.
Advantages of Using the Command Line
The command line is used mainly by advanced users. With its help, a person can automate the execution of certain tasks of the same type. For example, if you need to move, copy, or rename files under certain conditions, you can do it easily by creating special batch files using the command line. Moreover, such operations will run without user intervention.
Long story short, the advantage of using the command line becomes evident when you need to perform the same operation with numerous files. You can also use the command line to obtain the necessary information about the operation of network devices and estimate what can potentially cause malfunctions and failures. That’s what allows you to keep track of the network activity and its health.