38 Windows CMD Commands You Need To Know

38 Windows CMD Commands You Need To Know blog banner image

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:

  1. Click on the taskbar.
  2. Type “cmd” in the search field.
  3. Select “Command Prompt.”

To gain elevated privileges, follow these steps to access Command Prompt as an administrator:

  1. Right-click on “Command Prompt” from the search results.
  2. Select “Run as administrator.”

For Windows 7

  1. Navigate by clicking “Start” → “All Programs” → “Accessories”.
  2. For standard user rights, click on “Command Prompt.”
  3. 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.

  1. copy
    Copies one or more files to another location.
  2. del
    Deletes one or more files. For example, del file.txt deletes “file.txt” from the current directory.
  3. rename (or ren)
    Renames a file. For example, rename file.txt newfile.txt changes the file’s name to “newfile.txt”.
  4. xcopy
    Copies files and directories, including directory trees and system/hidden files, optionally using various parameters for more control.
  5. find
    Searches for a text string in a file or files, enabling simple text filtering tasks.
  6. robocopy
    Robust tool for syncing directories, ideal for backups.
  7. subst
    Maps a local folder as a drive letter.
  8. attrib
    Changes attributes of a file or directory. You can also use this CMD command in Windows 11: attrib -h -s -r C:\path\to\folder to show hidden files.
  9. 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.

  1. cd
    Changes your current directory.
  2. cd /
    Navigates to the root directory.
  3. dir
    Displays a list of files and subdirectories in a directory.
  4. mkdir (or md)
    Creates a new directory.
  5. rmdir (or rd)
    Removes a directory.
  6. 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:

  1. 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.
  2. ping
    Tests the ability to reach a specific network device.
  3. tracert
    Traces the path that a packet takes to reach a network host, helping identify where problems are occurring in the network.
  4. netstat
    Displays active connections, ports, Ethernet statistics and the IP routing table.
  5. nslookup
    Queries the DNS to obtain domain name or IP address mapping.
  6. netsh
    Allows configuration of almost any aspect of network settings.
  7. arp -a
    Displays current ARP entries by interrogating the current protocol data. It shows the IP address and matching MAC address.
  8. hostname
    Shows the computer’s network name, aiding in network identification and troubleshooting.
  9. pathping
    Combines the features of ping and tracert, providing more detailed information about network routes and latency.
  10. getmac
    Displays the MAC address of the network card.
  11. nbtstat
    Helps diagnose NetBIOS over TCP/IP connections and display protocol statistics.
  12. 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:

  1. systeminfo
    Provides a detailed overview of your system, including OS configuration, hardware details and network information.
  2. winver
    Quickly checks the version of Windows you are running.
  3. tasklist
    Lists all currently running processes along with their Process ID (PID).
  4. 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.
  5. 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:

  1. diskpart
    A tool for managing disk partitions.
  2. chkdsk
    Checks the disk for errors and repairs the file system.
  3. format
    Formats a disk with a specified file system.
  4. list disk
    Displays all the disks on the computer.
  5. select disk [number]
    Selects the disk where you want to perform operations.
  6. clean
    Removes all partitions from the selected disk.

Keep your systems and endpoints secure through automated patching and custom CMD scripts with NinjaOne.

Try it for free today!

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.

Next Steps

Building an efficient and effective IT team requires a centralized solution that acts as your core service deliver tool. NinjaOne enables IT teams to monitor, manage, secure, and support all their devices, wherever they are, without the need for complex on-premises infrastructure.

Learn more about Ninja Endpoint Management, check out a live tour, or start your free trial of the NinjaOne platform.

You might also like

Ready to become an IT Ninja?

Learn how NinjaOne can help you simplify IT operations.

Watch Demo×
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

Start your 14-day trial

No credit card required, full access to all features

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).