Whether you’re managing files, configuring network settings, or troubleshooting system issues, understanding Windows Command Prompt (CMD) can significantly boost your productivity. This article reviews our priority Windows CMD commands list: 38 essential commands that every user should know, from basic file operations to advanced network management.
Save time by automating repetitive tasks. Automate Windows CMD commands execution across multiple endpoints with NinjaOne!
Check out Ninja’s IT Automation System
How to access Windows Command Prompt
To use the Windows CMD commands in Windows 10 or any other version, you must first know how to access Windows Command Prompt. The steps can vary slightly depending on your version of Windows.
For Windows 8, 8.1, 10 and 11
Follow these steps for standard access:
- Click on the taskbar.
- Type “cmd” in the search field.
- Select “Command Prompt.”
To gain elevated privileges, follow these steps to access Command Prompt as an administrator:
- Right-click on “Command Prompt” from the search results.
- Select “Run as administrator.”
For Windows 7
- Navigate by clicking “Start” → “All Programs” → “Accessories”.
- For standard user rights, click on “Command Prompt.”
- For administrative rights, right-click on “Command Prompt” and choose “Run as administrator.”
With Command Prompt, you can use Windows CMD commands in Windows 10, 11 or earlier versions to manage files, directories, network settings and more.
How many Windows CMD commands are there?
The number of commands available in Windows Command Prompt can vary slightly depending on the version of Windows you are using. However, in general, there are around 280 to 300 built-in commands in CMD. This includes both simple commands used for everyday tasks like the copy command in Windows CMD and more advanced utilities for system diagnostics and configuration.
You can see most of the Windows CMD commands available to you by following these instructions.
38 Essential Windows admin CMD commands
Whether you’re a beginner looking to understand the basics or an experienced user aiming to refine your skills, this Windows CMD commands list covers the 38 fundamental admin CMD commands necessary for effective Windows management.
File management Windows CMD commands
This first group of Windows admin CMD commands simplifies copying, deleting and managing files and directories, streamlining your daily operations and enhancing your workflow.
- copy
Copies one or more files to another location. - del
Deletes one or more files. For example, del file.txt deletes “file.txt” from the current directory. - rename (or ren)
Renames a file. For example, rename file.txt newfile.txt changes the file’s name to “newfile.txt”. - xcopy
Copies files and directories, including directory trees and system/hidden files, optionally using various parameters for more control. - find
Searches for a text string in a file or files, enabling simple text filtering tasks. - robocopy
Robust tool for syncing directories, ideal for backups. - subst
Maps a local folder as a drive letter. - attrib
Changes attributes of a file or directory. You can also use this CMD command in Windows 11: attrib -h -s -r C:pathtofolder to show hidden files. - cipher
Encrypts or decrypts files and folders.
Directory navigation and management Windows CMD commands
Navigate directories and manage folder structures efficiently with these essential Windows CMD commands.
- cd
Changes your current directory. - cd /
Navigates to the root directory. - dir
Displays a list of files and subdirectories in a directory. - mkdir (or md)
Creates a new directory. - rmdir (or rd)
Removes a directory. - tree
Graphically displays the folder structure of a drive or path.
Network configuration and diagnostics Windows CMD commands
Network configuration commands are useful when troubleshooting or setting up new network connections. Here are some essential Windows admin CMD commands that will help you handle network-related tasks with precision:
- ipconfig
Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. Additional ipconfig commands are available here. - ping
Tests the ability to reach a specific network device. - tracert
Traces the path that a packet takes to reach a network host, helping identify where problems are occurring in the network. - netstat
Displays active connections, ports, Ethernet statistics and the IP routing table. - nslookup
Queries the DNS to obtain domain name or IP address mapping. - netsh
Allows configuration of almost any aspect of network settings. - arp -a
Displays current ARP entries by interrogating the current protocol data. It shows the IP address and matching MAC address. - hostname
Shows the computer’s network name, aiding in network identification and troubleshooting. - pathping
Combines the features of ping and tracert, providing more detailed information about network routes and latency. - getmac
Displays the MAC address of the network card. - nbtstat
Helps diagnose NetBIOS over TCP/IP connections and display protocol statistics. - shutdown /i
Remote shutdown tool for network management.
System information Windows CMD commands
Gathering comprehensive system information is crucial for troubleshooting in safe mode, system monitoring and ensuring your Windows setup is running optimally. Here are some essential Windows CMD commands that allow you to access detailed system information:
- systeminfo
Provides a detailed overview of your system, including OS configuration, hardware details and network information. - winver
Quickly checks the version of Windows you are running. - tasklist
Lists all currently running processes along with their Process ID (PID). - taskkill /PID [pid_number] /F
Forcefully terminates processes that are unresponsive or consuming too many resources. Replace [pid_number] with the actual PID from your tasklist. - wmic
Displays Windows Management Instrumentation (WMI) information, allowing more advanced system management through various subclasses (e.g., wmic product get name, wmic cpu get name).
Disk management Windows CMD commands
Disk management commands give you the flexibility to manage your storage resources directly from the command line, offering a powerful alternative to graphical user interface tools. Let’s wrap up our Windows CMD commands list with these tools to help you maintain optimal system performance and organization.
Here are some essential Windows CMD commands and their functions:
- diskpart
A tool for managing disk partitions. - chkdsk
Checks the disk for errors and repairs the file system. - format
Formats a disk with a specified file system. - list disk
Displays all the disks on the computer. - select disk [number]
Selects the disk where you want to perform operations. - clean
Removes all partitions from the selected disk.
Keep your systems and endpoints secure through automated patching and custom CMD scripts with NinjaOne.
Advanced Command Prompt tricks
In addition to your Windows CMD commands list, advanced Command Prompt tricks can significantly enhance your productivity, automate tasks and manage system operations more efficiently. These tricks often involve a combination of commands, scripting and deeper system functionalities that go beyond basic command line input.
Here are some advanced tricks and the reasons why they are beneficial:
Batch Scripting
Batch files allow you to automate repetitive tasks. By writing a script that contains a series of commands, you can run these commands sequentially without manual input each time, saving time and reducing errors.
Piping and Redirection
Using the pipe (|) and redirection (>, >>) operators, you can chain commands together or direct their output to files or other programs. For example, you can pipe the output of a dir command into findstr to search for specific files or redirect the output of a command to create a text file.
Environment Variables
Understanding and using environment variables can help you quickly access system paths and user settings and modify command behaviors. For instance, using %USERPROFILE% to access the current user’s home directory simplifies navigation and file management tasks.
Using Wildcards
Wildcards (* and ?) can make file management commands like copy, move and del more powerful by allowing you to specify patterns that match multiple files, which is useful for batch operations on files.