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 |
---|---|
Help | Showing basic CInternetnds and instructions on how each order works |
assoc | View and edit file extensions (you can specify which program to use to open which files) |
bitsadmin | Create or download or upload tasks and monitor their progress |
call | Calling a batch program from another without stopping the running batch program. This Command accepts labels as the call target |
cmd | Starts a new instance of the command prompt. If used without parameters, it displays the version and copyright information of the operating system |
comp | Compare the contents of two or more sets of files |
compact | Show or change file compression on NTFS drives |
CHDIR or CD | Display the name or change the current directory |
Cipher | Show 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 |
clip | Redirect 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. |
Chkdsk | Checking the disk and displaying a report of its status |
chants | Show or change the automatic disk check when starting the computer. If used without options, chkntfs displays the file system of the specified volume |
CLS | Clear the page |
cmd key | Creates, lists, and deletes saved usernames and passwords or credentials |
COLOR | Change the color and text of the CMD environment |
Copy | Copies one or more files to another location |
FTP debug | Change 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 |
diskcomp | Compare the content of two discs |
diskcopy | Copying the contents of one disk to another |
Diskpart | It helps you manage computer drives (disks, partitions, volumes, or virtual drives) |
Doskey | It has a user to call previously used commands and edit them and create macros |
Date | Display and adjust the date |
dir | Display a list of files and subdirectories in a directory |
echo | Display messages or turn command echoing on or off. If used without parameters, it displays the current echo settings |
even create | Creating a custom event in a specific event report for the admin |
del or Erase | Delete one or more files |
Exit | Exit the command line |
exec | This 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. |
Expand | Expand one or more compressed files. You can use this Command to recover compressed files. |
FC | Compare one or more separate files and display the differences |
Find | Search for a text string in one or more files |
Format | Format the disk for use with Windows |
gpfixup | After 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 |
gpupdate | Update Group Policy settings |
hostname | Display hostname |
label | Create or change or delete the label (name) of a drive. If used without parameters, it changes the current industry or removes an existing label |
logoff | Sign out of your Windows account |
MD or MKDIR | Create directory |
MOVE | Moving one or more files from one directory to another directory |
mode | Displays 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. |
msiexec | Provides a tool to install, modify, and perform operations on Windows Installer from the command line |
msinfo32 | Open the System Information tool to comprehensively view the local computer’s hardware and system components and the software environment. |
open files | It 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 |
Print text file | |
pause | Suspends the batch program processing and displays the “… Press any key to continue ” prompt |
pushd | Save the current directory and then change it |
popd | Changes the current directory to the directory most recently saved with the pushd Command |
RD | Delete directory |
rdpsign | Digital signature with remote desktop protocol file (rdp.) |
recover | Recover readable data from a damaged or defective disk |
ReFSUtil | is 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 RENAME | They are renaming one or more files. Directory and drive names cannot be changed with this Command. |
REPLACE | Replace files |
RMDIR | Delete directory |
ROBOCOPY | Advanced features for copying files and directory tree |
schtasks | Adds 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 |
retires | Configures and analyzes system security by comparing your current security configuration with specified security patterns |
SFC | It scans and verifies all protected system files and replaces incorrect versions with correct ones |
serverweroptin | Allows you to turn on error reporting |
shift | Changes the position of batch parameters in the batch file |
SHUTDOWN | Turn off the computer |
Systeminfo | It 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). |
takeown | It 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. |
TASKKILL | Terminate all running processes and services |
TASKLIST | Display a list of all running processes, including services |
time | Displays or sets the system time. If used without parameters, it displays the current system time and prompts you to enter a new time |
title | Creates a title for the command prompt window |
tree | Graphically 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 perf | It Writes performance data to the command window or a log file. It would help if you pressed CTRL+C to stop |
tzutil | Displays the Windows Time Zone tool |
VER | Displays the operating system version number |
verify | Tells the command prompt tool whether your files were written correctly to the drive. |
vol | The label shows the volume of the drive and the serial number if any. If used without parameters, it displays current drive information |
wbadmin | Backup and restore of the operating system, volumes, files, folders, and programs via the command line |
on West | It is a command line tool used to manage the Windows Deployment Services server |
webutil | Allows 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. |
where | Displays the location of files that match the given search pattern |
whoami | Displays 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 |
wines | Windows Remote Management allows you to manage and run programs remotely |
winsat mfmedi | Measures video decoding (playback) performance using the Media Foundation framework |
script | Windows Script Host provides an environment where users can run scripts in different languages that use other object models to perform tasks. |
Xcopy | Copies files and directories, including subdirectories |
Important CMD commands in the network discussion
order |
Function |
---|---|
PING | Checking the connection to the Internet or the desired network |
IPCONFIG | Shows 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. |
TRACERT | Troubleshooting possible network problems by sending packets and trying to connect to the intended destination |
GETMAC | Display MAC addresses for system network adapters |
NSLOOKUP | Find domain-specific IP address |
NETSTAT | It 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. |
NETSH | View all networkingInternetons and fine-tune network adapters in the system. Running this Command will change CMD to Network Shell mode |
pathping | Providing information about network delay and information about sending and losing packets through the network |
pktmon | It 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. |
qappsrv | Display a list of all remote desktop session hosting servers on the network |
***