blog posts

The Most Important And Useful CMD Commands

In This Article, You Will Get To Know The Important And Useful Windows Command Line (CMD) Commands In Different Sections.

Command Prompt, abbreviated as CMD, is a command line interpreter program. CMD is used to execute commands using expressions and letters.

Most of these commands automate tasks through scripts and batch files, perform advanced administrative functions, and troubleshoot or resolve specific types of Windows problems.

Command prompt or command line in Windows provides access to more than 280 types of commands. These commands use the command line interpreter instead of the Windows graphical interface to perform some operating system tasks.

For example, they allow you to copy data to another folder, format the entire disk, back up your files, send messages to other computers, or restart your computer.

These are some of the easiest things to do with CMD. Many tasks and commands can only be executed in this environment. Below is a comprehensive list of the most essential and valuable CMD commands available in Windows 7 to 11, Vista, and XP.

How to access CMD

There are several ways to open CMD:

  • The most common way to run it is through the Command Prompt shortcut in the Start menu. Also, you can find it by typing CMD in the start bar.
  • Another way to access the command prompt is through (Windows + R) Run and typing the CMD command. Alternatively, you can open cmd.exe from its original location at C:\Windows\system32\cmd.exe.
  • Another way to open the Command Prompt in some versions of Windows is through the Power User menu (WIN+X). However, depending on how your computer is set up, you may see PowerShell instead of Command Prompt.

Do not forget to execute many commands in the command prompt only if you have completed it as an administrator (Run as Administrator).

List of the most essential and valuable CMD commands

Below is a list of necessary and proper controls, some of which work immediately, some only in certain situations, and most only if you add more text or commands afterward.

If a particular command doesn’t execute immediately, read the command prompt’s error carefully, or do further investigation for your specific application. For example,? / del or search the Internet about that Command and its syntax. To see examples of how to use each Command, hit a space after typing it and insert ” ?/ “.

order

Function

HelpShowing basic CInternetnds and instructions on how each order works
assocView and edit file extensions (you can specify which program to use to open which files)
bitsadminCreate or download or upload tasks and monitor their progress
callCalling a batch program from another without stopping the running batch program. This Command accepts labels as the call target
cmdStarts a new instance of the command prompt. If used without parameters, it displays the version and copyright information of the operating system
compCompare the contents of two or more sets of files
compactShow or change file compression on NTFS drives
CHDIR or CDDisplay the name or change the current directory
CipherShow or change the encryption of directories and files on NTFS drives. If used without parameters, cipher displays the encryption status of the current directory and any files in it
clipRedirect command output from the command line to the Windows clipboard. You can use this Command to copy data directly into any program that can receive a text from the clipboard. Also, you can paste this text output into other programs.
ChkdskChecking the disk and displaying a report of its status
chantsShow or change the automatic disk check when starting the computer. If used without options, chkntfs displays the file system of the specified volume
CLSClear the page
cmd keyCreates, lists, and deletes saved usernames and passwords or credentials
COLORChange the color and text of the CMD environment
CopyCopies one or more files to another location
FTP debugChange the status of Debugging mode. This mode is off by default. If it’s on, you’ll see a < sign before every Command sent to the remote computer
diskcompCompare the content of two discs
diskcopyCopying the contents of one disk to another
DiskpartIt helps you manage computer drives (disks, partitions, volumes, or virtual drives)
DoskeyIt has a user to call previously used commands and edit them and create macros
DateDisplay and adjust the date
dirDisplay a list of files and subdirectories in a directory
echoDisplay messages or turn command echoing on or off. If used without parameters, it displays the current echo settings
even createCreating a custom event in a specific event report for the admin
del or EraseDelete one or more files
ExitExit the command line
execThis command copies or restores data as part of a backup or restore sequence. Run the script file on the local computer. If the script fails, an error is returned, and DiskShadow terminates.
ExpandExpand one or more compressed files. You can use this Command to recover compressed files.
FCCompare one or more separate files and display the differences
FindSearch for a text string in one or more files
FormatFormat the disk for use with Windows
gpfixupAfter the domain name change operation resolves domain name dependencies in Group Policy Objects and its links. To use this Command, you must install Group Policy Management as a feature through Server Manager
gpupdateUpdate Group Policy settings
hostnameDisplay hostname
labelCreate or change or delete the label (name) of a drive. If used without parameters, it changes the current industry or removes an existing label
logoffSign out of your Windows account
MD or MKDIRCreate directory
MOVEMoving one or more files from one directory to another directory
modeDisplays system status and changes system settings or reconfigures ports or devices. The mode displays all available console controllable properties and COM devices if used without parameters.
msiexecProvides a tool to install, modify, and perform operations on Windows Installer from the command line
msinfo32Open the System Information tool to comprehensively view the local computer’s hardware and system components and the software environment.
open filesIt helps the admin to display or query or disconnect files and directories opened in the system. This Command also enables or disables the Maintain Objects List system global flag
PRINTPrint text file
pauseSuspends the batch program processing and displays the “… Press any key to continue ” prompt
pushdSave the current directory and then change it
popdChanges the current directory to the directory most recently saved with the pushd Command
RDDelete directory
rdpsignDigital signature with remote desktop protocol file (rdp.)
recoverRecover readable data from a damaged or defective disk
ReFSUtilis a tool included with Windows and Windows Server that attempts to detect severely damaged ReFS volumes and identify the remaining files and copy those files to another volume
REN or RENAMEThey are renaming one or more files. Directory and drive names cannot be changed with this Command.
REPLACEReplace files
RMDIRDelete directory
ROBOCOPYAdvanced features for copying files and directory tree
schtasksAdds and removes commands and programs to run periodically or at a specific time and tasks from the program. It also starts and stops tasks on demand and displays and changes scheduled tasks
retiresConfigures and analyzes system security by comparing your current security configuration with specified security patterns
SFCIt scans and verifies all protected system files and replaces incorrect versions with correct ones
serverweroptinAllows you to turn on error reporting
shiftChanges the position of batch parameters in the batch file
SHUTDOWNTurn off the computer
SysteminfoIt Displays detailed configuration information about a computer and its operating system, including functional system configuration, security information, product ID, and hardware characteristics (such as RAM, disk space, and network cards).
takeownIt helps the admin restore the previously denied access to the file and makes the admin the file owner. This Command is usually used in batch files.
TASKKILLTerminate all running processes and services
TASKLISTDisplay a list of all running processes, including services
timeDisplays or sets the system time. If used without parameters, it displays the current system time and prompts you to enter a new time
titleCreates a title for the command prompt window
treeGraphically displays the directory structure of a path or disk in a drive. The form displayed with this Command depends on the parameters you specify on the command line. If you do not specify a purpose or path, this Command displays a tree structure starting with the current directory of the current campaign.
type perfIt Writes performance data to the command window or a log file. It would help if you pressed CTRL+C to stop
tzutilDisplays the Windows Time Zone tool
VERDisplays the operating system version number
verifyTells the command prompt tool whether your files were written correctly to the drive.
volThe label shows the volume of the drive and the serial number if any. If used without parameters, it displays current drive information
wbadminBackup and restore of the operating system, volumes, files, folders, and programs via the command line
on WestIt is a command line tool used to manage the Windows Deployment Services server
webutilAllows you to retrieve information about reporting events and publishers. You can also use this Command to install and remove event manifests, run queries, and export, archive, and purge logs.
whereDisplays the location of files that match the given search pattern
whoamiDisplays the user and group information and privileges of the user currently logged in to the local system. If used without parameters, it shows the current domain and username
winesWindows Remote Management allows you to manage and run programs remotely
winsat mfmediMeasures video decoding (playback) performance using the Media Foundation framework
scriptWindows Script Host provides an environment where users can run scripts in different languages ​​that use other object models to perform tasks.
XcopyCopies files and directories, including subdirectories

Important CMD commands in the network discussion

order

Function

PINGChecking the connection to the Internet or the desired network
IPCONFIGShows the information of the network internet available on the system and their details. The most important information from this Command is the IPv4 address and Default Gateway details of the wireless network adapter and the Ethernet network adapter.
TRACERTTroubleshooting possible network problems by sending packets and trying to connect to the intended destination
GETMACDisplay MAC addresses for system network adapters
NSLOOKUPFind domain-specific IP address
NETSTATIt Displays general statistics and troubleshooting, and network analysis. It shows the active connections in the system, such as LAN, within the network or link on the Internet and covers the port information completely.
NETSHView all networkingInternetons and fine-tune network adapters in the system. Running this Command will change CMD to Network Shell mode
pathpingProviding information about network delay and information about sending and losing packets through the network
pktmonIt is a cross-component and in-box network diagnostic tool for Windows, which is used to detect lost and received packets, and filter and count boxes.
qappsrvDisplay a list of all remote desktop session hosting servers on the network

***

We hope this article was helpful to you. What is the most used CMD command for you? Which controls do you use that is not mentioned in this article?