26 Windows CMD Commands for Everyone (2024 Updated)
Last Updated :
26 Nov, 2024
The Windows Command Prompt (CMD) is a powerful tool that allows users to interact with their operating system through text-based commands. Whether you’re a beginner exploring CMD for the first time, an expert troubleshooting advanced issues, or just looking for utility-focused tasks, this guide has you covered.
In this guide, we will provide you with some of the most useful commands for the following:
- CMD Commands for Beginners
- CMD Commands for Experts
- CMD Commands for Utility
- CMD Commands for Troubleshooting
- CMD Commands for Students
- CMD Commands for Programmers
CMD Commands for Beginners
These commands are essential for users who are new to CMD and provide basic functionalities to help them navigate and perform simple tasks.
1. View Directory ‘dir‘
- Function: Displays the contents of the current directory.
- How to use: Type
dir and press Enter. Use dir /s to include subdirectories.
- Use case: Quickly view files and folders in your current location.
Syntax: dir
2. Change Directories ‘cd’
- Function: Lets you navigate between folders.
- How to use: Type
cd [folder name] to move into a directory. Use cd .. to go up one level.
- Use case: Navigate to specific directories to manage files or execute commands
Syntax: cd [folder name]
3. Close ‘exit’
- Function: Closes the Command Prompt window.
- How to use: Type
exit and press Enter.
- Use case: Ends your session with CMD.
Syntax: exit
4. Clear Screen ‘cls’
- Function: Clears all text from the CMD window.
- How to use: Type
cls and press Enter.
- Use case: Removes clutter after multiple commands
Syntax: cls
5. View Available Command ‘help’
- Function: Lists all available commands and their descriptions.
- How to use: Type
help and press Enter.
- Use case: Discover new commands and learn their functions.
Syntax: help
CMD Commands for Experts
These commands are more advanced and suitable for users comfortable with troubleshooting and system management tasks.
1. System File Checker ‘sfc’
- Function: Scans and repairs corrupted system files.
- How to use: Type
sfc /scannow in CMD (run as administrator).
- Use case: Fix system errors related to missing or corrupted files.
Syntax: sfc /scannow
2. Disk Error ‘chkdsk’
- Function: Scans the hard drive for bad sectors and file system errors.
- How to use: Type
chkdsk [drive letter]: /f (e.g., chkdsk C: /f) in CMD.
- Use case: Identify and fix disk issues.
Syntax: chkdsk C: /f
3. View Running Processor ‘tasklist’
- Function: Displays all running processes and their details.
- How to use: Type
tasklist to list processes. Use tasklist /fi "imagename eq [process name]" to filter.
- Use case: Identify resource-heavy or unresponsive processes.
Syntax: tasklist /fi "imagename eq [process name]
4. Restart ‘shutdown’
- Function: Allows you to shut down or restart the computer via CMD.
- How to use:
- Shutdown:
shutdown /s /f /t [seconds].
- Restart:
shutdown /r /f /t [seconds].
- Use case: Automate shutdown or restart tasks
Syntax:
Shutdown: shutdown /s /f /t [seconds].
Restart: shutdown /r /f /t [seconds].
5. Network Statistics ‘netstat’
- Function: Displays active connections and listening ports.
- How to use: Type
netstat to view all active connections.
- Use case: Diagnose network-related issues or monitor network activity.
Syntax: netstat
CMD Commands for Utility
These commands are focused on specific tasks and utilities to enhance productivity and system performance.
1. Network Configuration ‘ipconfig’
- Function: Displays IP address, subnet mask, and gateway information.
- How to use:
- Basic: Type
ipconfig.
- Detailed: Type
ipconfig /all.
- Use case: Troubleshoot internet connectivity issues.
Syntax: ipconfig
2. Network Connectivity ‘ping’
- Function: Sends packets to test communication with another device or website.
- How to use: Type
ping [destination]
- Use case: Check if a device or website is reachable.
Syntax: ping geeksforgeeks.org
3. System Information ‘systeminfo’
- Function: Displays detailed information about your computer.
- How to use: Type
systeminfo.
- Use case: Quickly access system specifications for troubleshooting or reporting.
Syntax: systeminfo
4. Trace Route ‘tracert’
- Function: Shows the path packets take to reach a specific destination.
- How to use: Type
tracert [destination]
- Use case: Identify network bottlenecks or connectivity issues.
Syntax: tracert geeksforgeeks.org
5. Manage Drives ‘diskpart’
- Function: Opens a command-line utility for managing disk partitions.
- How to use: Type
diskpart to enter the disk management interface.
- Use case: Create, delete, or modify partitions on your drives.
Syntax: diskpart
CMD Commands for Troubleshooting
1. File Comparison ‘fc’
- Function: Compares two files and highlights differences.
- How to use: Type
fc [file1] [file2] to compare files.
- Use case: Detect changes or errors in files
Syntax: fc 1 2
2. Advanced Network Diagnostics ‘pathping’
- Function: Combines
ping and tracert functionalities to provide detailed network path diagnostics.
- How to use: Type
pathping [destination]
- Use case: Troubleshoot complex network issues.
Syntax: pathping geeksforgeeks.org
3. Registry Editor ‘regedit’
- Function: Launches the Windows Registry Editor.
- How to use: Type
regedit to open the registry.
- Use case: Modify registry keys for advanced configuration or troubleshooting.
Syntax: regedit
4. View MAC ‘getmac’
- Function: Displays the MAC address of your network adapter.
- How to use: Type
getmac to view the MAC address.
- Use case: Identify your device’s hardware address for network configurations
Syntax: getmac
5. Power Configuration ‘powercfg’
- Function: Displays and manages power settings.
- How to use: Type
powercfg /[option]
- Use case: Optimize power usage and troubleshoot battery issues.
Syntax: powercfg /energy for a detailed power usage report
CMD Commands for Students
Students can use these commands to manage files, perform simple calculations, and even help with tasks like coding and studying.
1. Calculator ‘calc’
- Function: Opens the Windows Calculator application.
- How to use: Type
calc and press Enter.
- Use case: Quickly open the calculator for
Syntax: calc
CMD Commands for Programmers
Programmers often use CMD to automate tasks, compile code, and test network functionality. These commands can be especially useful for developers working in command-line environments.
1. Compile Java Code ‘javac’
- Function: Compiles Java source files into bytecode.
- How to use: Type
javac [file name].java to compile Java code.
- Use case: Compile and test Java programs directly from the command line.
Syntax: javac
2. Version Control ‘git’
- Function: Interacts with Git repositories from the command line.
- How to use: Type
git [command]
- Use case: Manage version control, clone repositories, or push commits from the command line.
Syntax: git clone [repository URL]
3. Execute Python Script ‘python’
- Function: Runs Python scripts in the command prompt.
- How to use: Type
python [script.py] to execute a Python program.
- Use case: Test and run Python code directly in the command line.
Syntax: python [script.py]
4. Run Node.js Scripts ‘node’
- Function: Executes Node.js scripts.
- How to use: Type
node [script.js] to run a JavaScript file using Node.js.
- Use case: Run backend scripts and test JavaScript programs in the command line.
Syntax: node [script.js]
5. Node Package Manager ‘npm’
- Function: Installs and manages JavaScript packages.
- How to use: Type
npm install [package] to install a package.
- Use case: Manage dependencies and libraries in Node.js applications.
Syntax: npm install [package]
Conclusion
Mastering the most useful CMD commands in Windows can empower you to perform tasks more efficiently, troubleshoot problems, and gain deeper control over your system. By familiarizing yourself with these essential CMD commands, you’ll be better equipped to handle a variety of situations, from simple file management to advanced system configurations. Whether you’re a beginner or an experienced user, these commands are invaluable tools to have at your disposal.
Windows CMD Commands for Everyone – FAQ’s
How do I open Command Prompt in Windows?
Use the Windows search bar, type cmd, and press Enter. Alternatively, press Windows + R, type cmd, and hit Enter.
How can I manage files using CMD?
Use commands like cd (change directory), mkdir (create directory), del (delete files), and copy (copy files).
How do I clear my DNS cache?
Run ipconfig /flushdns to clear the DNS cache.
How can CMD commands help with troubleshooting in Windows?
CMD commands like ipconfig for checking network configuration, chkdsk for scanning and fixing disk errors, and sfc /scannow for repairing system files are among the best CMD commands for Windows troubleshooting.
Are there any CMD commands that every Windows user should know?
Yes, commands like ping for testing network connectivity, tasklist for viewing running processes, and shutdown for turning off or restarting the computer are CMD commands every Windows user should know.
What are some advanced CMD commands in Windows?
Advanced CMD commands in Windows include netstat for network statistics, diskpart for disk management, and robocopy for robust file copying. These commands offer more control over system operations and configurations.
How can I learn more about CMD commands and their usage?
You can learn more about Windows command prompt commands by typing help in the Command Prompt, which provides a list of available commands along with a brief description of each. Additionally, online resources and tutorials can offer deeper insights.
Get 90% Course fee refund on completing 90% course in 90 days! Take the Three 90 Challenge today.
The next 90 Days of focus & determination can unlock your full potential. The Three 90 challenge has started and this is your chance to upskill and get 90% refund. What more motivation do you need? Start the challenge right away!
Similar Reads
26 Windows CMD Commands for Everyone (2024 Updated)
The Windows Command Prompt (CMD) is a powerful tool that allows users to interact with their operating system through text-based commands. Whether you're a beginner exploring CMD for the first time, an expert troubleshooting advanced issues, or just looking for utility-focused tasks, this guide has
7 min read
Useful CMD Commands for Daily Use in Windows OS
The Windows Command Prompt (CMD) is a powerful tool that many users overlook, but knowing a few useful CMD commands for Windows can make your daily tasks much more efficient. From navigating the file system to managing network settings, these daily use CMD commands can help streamline your workflow
3 min read
How to use CMD for Python in Windows 10?
Using the Command Prompt (CMD) is a powerful way to interact with Python on your Windows 10 machine. Whether you're writing scripts, testing code, or running Python programs, knowing how to use CMD for Python in Windows 10 is essential. This article will show you how to run Python in CMD Windows 10,
4 min read
CMD Commands to Gather Information of a System
Command Prompt in Windows offers a range of commands to gather detailed information about your system's hardware, software, and overall health. These CMD commands provide quick access to system details, making it easier to diagnose issues, check specifications, and retrieve essential information. In
7 min read
How to Use the Xcopy Command in Windows?
The xcopy command in Windows is a powerful tool for copying files and directories. It extends the functionality of the standard copy command by allowing the copy of entire directories along with their subdirectories and files all at once. This makes xcopy highly useful for tasks such as backing up f
5 min read
Command Prompt Hacks for Windows
The Command Prompt in Windows is a powerful tool that allows users to perform a wide range of tasks, from basic file management to advanced system commands. However, many users are unaware of the numerous Command Prompt hacks for Windows that can enhance productivity and simplify complex tasks. In t
6 min read
How to Open Command Prompt in Windows - 10 Methods
Command Prompt (CMD) is a powerful tool in Windows 7, 8, 9, 10 and 11 that allows users to execute commands, troubleshoot issues, and perform advanced administrative tasks. Knowing various ways to access CMD ensures you’re always ready to tackle system challenges, whether you’re at the desktop or fa
9 min read
How to Clear the Windows Command Prompt Screen?
If you've been working in the Windows Command Prompt and your screen is cluttered with text, knowing how to clear the Windows Command Prompt screen can make your workspace much tidier and easier to manage. This simple task can help you focus on the commands you're working on without distraction. In
6 min read
How to Repair Windows 10 Using Command Prompt - 5 Methods
Command Prompt (CMD) is a powerful tool for troubleshooting and fixing errors in Windows. This guide will walk you through the various CMD commands and techniques to resolve Windows errors efficiently. Whether you're facing issues with Windows updates, error messages, or general system problems, CMD
6 min read
How to Abort a Command Execution in Command Prompt?
When working in the Command Prompt, there are times when you need to halt a running command immediately. Understanding how to abort command execution in CMD can save you from potential issues and wasted time. In this guide, we'll explore various methods to stop commands, including using `Ctrl+C`, te
5 min read
Windows 11 Tips and Tricks for 2024: Enhance Your Productivity
Windows 11 is a sleek, updated version of Windows 10, with new features and settings. It offers a plethora of tools to enhance productivity and make your computer feel more personalized. Microsoft is constantly refining and updating Windows 11. In this article, we’ll explore 15+ tips and tricks to h
9 min read
10 Methods To Open Notepad in Windows
Notepad is a simple yet powerful text editor available on all Windows versions. Whether you use it for quick note-taking or coding, there are many ways to open Notepad in Windows. From using shortcut keys to running commands in PowerShell, we’ll cover 10 different methods to open Notepad so you can
5 min read
Basic Linux Commands for day to day life
Linux is a popular desktop, embedded, and server operating system that is strong and adaptable. Knowing the basics of commands will greatly increase your productivity and simplicity of use if you use Linux. Essential Linux commands that are useful for daily operations will be covered in this article
3 min read
How to Open the Command Prompt as Administrator in Windows
Command Prompt (CMD) is a built-in command-line utility in Windows 10 and 11 that allows users to execute system commands, troubleshoot issues, and perform administrative tasks. While the standard CMD window is sufficient for most tasks, some commands require elevated permissions. In such cases, you
4 min read
How to Open Google Chrome Using CMD on Windows 11?
Opening Google Chrome using CMD in Windows 11 is a convenient way to launch the browser without needing to use the graphical interface. Whether you're troubleshooting or simply prefer using the command line, this guide will show you how to run Chrome via CMD on Windows 11. The steps are easy and can
4 min read
How to Change Windows Computer Password using CMD
If you are a Windows user, one of the easiest ways to change your password is through the Command Prompt (CMD). This is especially helpful for users who prefer command-line tools or face issues accessing the standard settings menu. In this article, we’ll guide you through the steps to change your Wi
4 min read
How to Remotely Start Windows through CMD?
Command Prompt (CMD) is a powerful tool not only for troubleshooting Windows errors but also for remotely managing systems. In this guide, we'll focus on using CMD to remotely start a Windows computer. Whether you're troubleshooting a system that's out of reach or simply want to save time by startin
4 min read
11 Ways To Open Task Manager in Windows 10/11
Wondering how to open Task Manager in Windows quickly? Whether you're using Windows 10 or Windows 11, there are multiple ways to access this crucial tool to monitor system performance, manage processes, and troubleshoot issues. 11 Ways To Open Task Manager This guide will show you 11 different ways
7 min read
How to Open Control Panel on Windows 11
The Control Panel in Windows 11 will be indispensable tool for working on advanced settings such as installing/uninstalling programs, configuring networks, or modifying user accounts. Interestingly, Control Panel can be accessed using different methods in Windows 11 and these different methods will
7 min read