Summary of common Run CMD commands

To access a folder on the computer, or execute some commands on Windows, we often use the Run dialog box and enter the path or command. This will help users access and operate faster. Or some accesses on Windows require using this command line interface. Therefore, having common and frequently used Run CMD commands in hand will help us get results faster. In the article below, we will summarize common Run commands for readers.

First, we need to open the Run dialog box using the Windows + R key combination and type the keyword cmd , press OK to access.

Summary of common Run CMD commands

29 Command Prompt Commands You Must Know

1. PING command

Command line: ping ip/host/[/t][/a][/l][/n]

In there:

  • ip: IP address of the computer to be checked, host is the name of the computer to be checked for network connection. Users can use either the IP address or the computer name.
  • /t: requests to continuously send packets to the destination machine until you press Ctrl + C to end.
  • /a: get IP address from computer name.
  • /l: specifies the width of the packet sent for testing.
  • /n: specifies the number of packets sent.

How to use the PING command: we can use the PING command line when we want to check whether the computer is connected to the Internet or not. When executing the PING command, packets from the computer to be checked are sent to the destination computer, from which the user can check the transmission line or determine whether the computer is connected to the network or not.

2. Tracert command

Command line:tracert ip/host

In which: ip/host is the IP address or computer name to be checked.

How to use the Tracert command: The Tracert command is used to display the path of packets from the testing computer to the destination computer, through which server or router.

Summary of common Run CMD commands

3. Netstat command

Command line:Netstat [/a][/e][/n]

In there:

  • /a: displays all connections and open ports.
  • /e: Ethernet statistics information.
  • /n: display addresses and port numbers.

How to use the Netstat command: helps users know the connections in and out of the computer they want to check.

4. Ipconfig command

Command line:ipconfig /all

How to use the command ipconfig /all: displays information of the computer being checked including host name, IP address, DNS,...

Summary of common Run CMD commands

5. Shutdown command

Command line:

  • Shutdown -s -t [a]: shutdown (on Windows 7).
  • Shutdown -r -t [a]: start the machine.

In which: a is the time to turn the machine on or off, calculated in seconds.

Summary of common Run CMD commands

How to use the Shutdown command: shut down or restart the computer according to a preset schedule. In addition, readers can refer to how to schedule shutdown for Windows 10 computers in the article Instructions for scheduling shutdown of Windows 10 computers .

6. DIR command

Command line:DIR [drive:] [path][filename]

In there:

  • Path: path to file or directory.
  • Filename: file name.

DIR command function: helps users search and check files and folders on the computer.

7. DEL command

Command line: DEL [/p][/f][/s][/q][/a[[:]attributes]] "tên file cần xóa"

In there:

  • /p: display file information before deleting.
  • /f: delete files with read-only attribute.
  • /s: delete all files that appear in any directory.
  • /q: delete without asking.
  • /a[[:]attributes]: delete by file attributes (R: Read-only files, S: System files, H: Hidden files).

DEL command usage: delete files on the computer.

8. COPY command

Command line:COPY "địa chỉ file cần copy" "địa chỉ lưu file copy" /y

In which: /y is to copy the file without asking.

How to use the COPY command: used when you want to move files from one folder to another folder on your computer.

Summary of common Run CMD commands

9. RD command

Command line:RD /s /q "thư mục cần xóa"

In there:

  • /s: delete entire directory.
  • /q: delete directory without asking.

How to use the RD command: in case we want to quickly delete a folder on the computer, we can apply this command.

Summary of common Run CMD commands

10. MD command

Command line:MD "đường dẫn lưu file cần tạo"\"tên thư mục cần tạo"

How to use MD command: used to create new folder in drive.

For example: MD "D:\Amnhac" to create the Amnhac folder in drive D of the computer.

Summary of common Run CMD commands

11. TASKKILL command

Command line:taskkill /f /im "tên ứng dụng".exe

How to use the TASKKILL command: turn off running software in case the software has problems and cannot be exited directly.

12. REG ADD command

Command line:REG ADD KeyName [/v ValueName] [/t Type] [/s Separator] [/d Data] [/f]

In there:

  • KeyName: path to the key.
  • /v ValueName: name of the value to create in the Registry.
  • /t Type: data type.
  • /d Data: initial data for the value just created.

How to use the REG ADD command: use the command to create and edit the Registry.

13. REG DELETE command

Command line:REG DELETE KeyName [/v ValueName] [/f]

In which: [/v ValueName] is the name of the value to delete.

How to use the REG DELETE command: used when you want to delete a value in the Registry.

14. REGEDIT.EXE command

Command line: Regedit.exe /s "nơi chứa file .reg"

In which: /s no need to ask.

How to use: used when running .reg file.

15. ATTRIB command

Command line: ATTRIB -a -s -h -r "file, thư mục" /s /d orATTRIB +a +s +h +r "file, thư mục" /s /d

In there:

  • + sign: add to attribute.
  • - sign: remove attribute.
  • a: archive is the archive attribute.
  • s:system is a system property.
  • h: hidden is a hidden attribute.
  • r: read-only is a read-only attribute.
  • /s: execute with all files in the directory and subdirectories.
  • /d: set attributes for directories and subdirectories.

Usage: used to set attributes for files or folders.

16. Assoc command

Summary of common Run CMD commands
Assoc command

Most files in Windows are associated with a specific program that is assigned to open the file by default. Sometimes it can be confusing to remember these associations. You can remind yourself by entering the assoc command to display a complete list of file name extensions and program associations.

You can also expand the command to change file associations. For example, assoc .txt= will change the association for text files to whatever program you type after the equals sign. The Assoc command itself will reveal both the extension name and the program name, which will help you use the command correctly.

In Windows 10, you can see a more user-friendly interface, which also allows you to change file type associations on the fly. Go to Settings (Windows + I) > Apps > Default apps > Choose default app by file type .

17. Cipher command

Summary of common Run CMD commands
Cipher command

Removing files on a mechanical hard drive doesn't actually delete them. Instead, it marks the files as inaccessible and the space they take up becomes unused. The files remain recoverable until the system overwrites them with new data, which can take some time.

However, the cipher command will delete a directory by writing random data to it. For example, to delete drive C, you would use the cipher /w:d command , which will wipe the free space on the drive. The command does not overwrite undelete data, so you will not wipe out the files you need by running this command.

You can use a variety of other cipher commands, however, they are often redundant with versions of Windows that support BitLocker .

18. Driverquery command

Summary of common Run CMD commands
Driverquery command

Drivers are still some of the most important pieces of software installed on your PC. Missing or incorrectly configured drivers can cause all sorts of problems, so it’s good to have access to a list of the drivers on your PC. That’s exactly what the driverquery command does. You can expand it to driverquery -v to get more information, including the directory in which the driver is installed.

19. File Compare command

Summary of common Run CMD commands
File Compare command

You can use this command to determine the text differences between two files. It is especially useful for writers and programmers trying to find small changes between two versions of a file. Just type fc , followed by the directory path and names of the two files you want to compare.

You can also extend the command in a number of ways. Typing /b compares only binary output, /c ignores uppercase and lowercase in comparisons, and /l compares only ASCII text.

So, for example, you could use the command like this:

fc /l "C:\Program Files (x86)\example1.doc" "C:\Program Files (x86)\example2.doc"

The above command compares the ASCII text in two Word files.

20. PathPing Command

Summary of common Run CMD commands
PathPing Command

This is a more advanced version of ping that is useful if there are multiple routers between your PC and the device you are testing. Like ping, you use this command by typing pathping followed by the IP address, but unlike ping, pathping also relays some information about the path the test packets take.

21. Powercfg command

Summary of common Run CMD commands
Powercfg command

Powercfg is a very powerful command for managing and monitoring how your computer uses power. You can use the powercfg hibernate on and powercfg hibernate off commands to manage hibernation; or you can also use the powercfg /a command to see the current power saving states on your PC.

Another useful command is powercfg /devicequery s1_supported , which displays a list of devices on your computer that support connected standby. When enabled, you can use these devices to wake your computer from standby, even remotely. You can enable this feature by selecting the device in Device Manager , opening the device's properties, going to the Power Management tab , and then checking the Allow this device to wake the computer box .

Powercfg /lastwake will tell you which device last woke your PC from sleep. You can use this command to troubleshoot your PC if it seems to be randomly waking up from sleep.

You can use the powercfg /energy command to generate a detailed power consumption report for your PC. The report is saved to the specified folder after the command finishes. This report will tell you about any system errors that may be causing increased power consumption, such as devices that block certain sleep modes or are poorly configured to meet your power management settings.

Windows 8 added powercfg /batteryreport , which provides detailed analysis of battery usage, if available. Typically exported to your Windows user folder, the report provides details on the duration and length of charge and discharge cycles, average battery life, and estimated battery capacity.

22. Systeminfo command

Systeminfo command

This command will give you an overview of your computer's detailed configuration. The list includes your operating system and hardware. For example, you can look up the original Windows installation date, last boot time, BIOS version, total and available memory, installed hotfixes, network card configuration, and more.

Use systeminfo /s followed by the host name of a computer on the local network, to get remote information for that system.

This may require additional syntax elements for domain, username, and password, as follows:

systeminfo /s [host_name] /u [domain]\[user_name] /p [user_password]

23. System File Checker command

Summary of common Run CMD commands
System File Checker command

System File Checker is an automatic scanning and repair tool that focuses on Windows system files.

You'll need to run Command Prompt with admin rights and enter the command sfc /scannow . If SFC finds any corrupt or missing files, it will automatically replace them using cached copies kept by Windows specifically for this purpose. The command may take half an hour to run on older laptops.

24. Tasklist command

Summary of common Run CMD commands
Tasklist command

You can use the tasklist command to get a current list of all the tasks running on your PC. While somewhat redundant given the existence of Task Manager , this command can sometimes find tasks that are hidden from view in that utility.

There are also a variety of modifiers. Tasklist -svc shows the services associated with each task, use tasklist -v for more details on each task, and tasklist -m will locate the DLL files associated with the active tasks. These commands are useful for advanced troubleshooting.

25. Chkdsk command

Summary of common Run CMD commands
Chkdsk command

Windows automatically flags a drive for a diagnostic chkdsk scan when symptoms indicate that the local drive has bad sectors , lost clusters, or other logical or physical errors.

If you suspect your hard drive is failing, you can start a scan manually. The most basic command is chkdsk c: , which will immediately scan the C: drive without restarting your computer. If you add parameters like /f, /r, /x, or /b , as in chkdsk /f /r /x /bc: , chkdsk will also repair errors, recover data, unmount the drive, or clear the bad sector list, respectively. These tasks require a reboot, as they can only run when Windows is powered off.

26. Schtasks command

Summary of common Run CMD commands
Schtasks command

Schtasks is Command Prompt access to Task Scheduler, one of the many underrated Windows admin tools. While you can use the GUI to manage your scheduled tasks, Command Prompt lets you copy and paste complex commands to set up multiple similar tasks without having to click through multiple options.

For example, you can schedule your computer to restart at 11pm every Friday:

schtasks /create /sc weekly /d FRI /tn "auto reboot computer weekly" /st 23:00 /tr "shutdown -r -f -t 10"

To supplement weekly restarts, you can schedule tasks to launch specific programs at startup:

schtasks /create /sc onstart /tn "launch Chrome on startup" /tr "C:\Program Files (x86)\Google\Chrome\Application\Chrome.exe"

To replicate the above command for different programs, just copy, paste and modify it as needed.

27. Net Use command

If you want to map a new drive, you can always open File Explorer , right-click This PC , and go through the steps in the Map Network Drive wizard . However, using the Net Use command, you can do the same thing with a series of commands.

For example, if you have a shared folder on a computer on your network named \\OTHER-COMPUTER\SHARE\ , you can map it to your own Z: drive by typing the command:

net use Z: “\\OTHER-COMPUTER\SHARE” /persistent:yes

A persistent switch tells your computer that you want this drive to be remapped every time you log back into your computer.

28. Format command

Summary of common Run CMD commands
Windows Command Prompt displays the format command with various parameters.

When you need to format a drive, you can use the Windows File Explorer GUI or switch to Command Prompt. You will need admin rights to use this command. Make sure you specify the volume you want to format, followed by the desired parameters.

The command below will quickly format drive D with exFAT file system, with size of 2048 bytes and rename the volume to "label" (without quotes).

format D: /Q /FS:exFAT /A:2048 /V:label

You can also use this command to unmount the volume (/X) or, if it is formatted with NTFS, set the file compression mode to the default setting (/R). If you get stuck, use format /? to search for help.

29. cls command

If you find yourself cluttering up your Command Prompt window trying all of the commands above, there's one final command you need to know to clean it all up again.

cls

That's all! Very simple right?

Other Windows CMD Commands

As you can see, there are some useful and powerful things you can do with the Windows Command Prompt, if you know the right commands.

There are even many commands that give you the ability to do some things that you might never have thought possible just by typing a simple command.

  • BITSADMIN : Start upload or download jobs over the network or Internet and monitor the current status of those file transfers.
  • COLOR : Change the background color of the Command Prompt window.
  • COMP : Compare the contents of any two files to see the differences.
  • FIND/FINDSTR : Search for strings within any ASCII file.
  • PROMPT : Change the command prompt from C:\> to something else.
  • TITLE : Change the title of the Command Prompt window.
  • REGEDIT : Edit keys in Windows registry (use with caution).
  • ROBOCOPY : A powerful file copy utility built right into Windows.

Good luck!

Sign up and earn $1000 a day ⋙

Leave a Comment

How to use Command Prompt, how to use cmd on Windows

How to use Command Prompt, how to use cmd on Windows

Hidden deep within Windows is a world of command lines that few people know about. In this article, we will guide you on how to fix errors and make your computer more secure using the cmd command line tool.

8 CMD Commands to Manage Wireless Networks on Windows

8 CMD Commands to Manage Wireless Networks on Windows

To manage wireless network connections on your Windows 10 computer, you can use the Settings app or Control Panel. However, there are many advanced settings that you cannot find in the Settings app or Control Panel. In this case, you can use Command Prompt.

How to map a network drive in Windows 10

How to map a network drive in Windows 10

Accessing files from your system's local hard drive is one of the easiest things you can do on your computer. But what if you want to access files located on other systems' hard drives?

How to Clean Windows PC Using Command Prompt

How to Clean Windows PC Using Command Prompt

Windows has a number of built-in system cleanup utilities, including the Disk Cleanup tool. However, the Command Prompt is a lesser-known way to clean up your computer.

Configure TCP/IP from the command line

Configure TCP/IP from the command line

To configure TCP/IP like IP address, Subnet Mask, Default Gateway, DNS and WINS addresses and many other options you can use Netsh.exe or Netsh command.

How to fix the error “Ethernet doesnt have a valid IP configuration”

How to fix the error “Ethernet doesnt have a valid IP configuration”

Sometimes DHCP cannot get a valid IP address from the Network Interface Card, it will show an error message “Ethernet doesn't have a valid IP configuration”.

12 useful Command Prompt tips on Windows 10

12 useful Command Prompt tips on Windows 10

Command Prompt can automate many tasks, handle problems and perform all kinds of functions. The following 12 Command Prompt tips will help you make the most of this utility on Windows 10.

How to add the Open command window here feature when right-clicking on every folder

How to add the Open command window here feature when right-clicking on every folder

The Command Prompt (CMD) window is no stranger to users who like to mess with their computers, this window can tweak some important things on the system or the folders and data are installed outside. by lines of code.

Guide to build Void Walker DTCL season 8.5

Guide to build Void Walker DTCL season 8.5

This DTCL season 8.5 Void Traveler is a sub-race and of course, with only 3 generals, these generals must really stand out to have a place in other formations.

How to fix sound problems on Xbox

How to fix sound problems on Xbox

It can be difficult to troubleshoot sound issues on Xbox when the problem can occur anywhere between your TV setup and your Xbox system settings.

Answer to the question: Being a professional soccer player in Lien Quan

Answer to the question: Being a professional soccer player in Lien Quan

Being a professional soccer player is one of the suggestions in the Grass Professor event of Lien Quan Mobile. Let's explore with Quantrimang to see who the character this event wants to mention is.

18 mysterious and strange places appearing on Google Earth that make people surprised

18 mysterious and strange places appearing on Google Earth that make people surprised

The vast Earth has many mysterious lands that humans have not known and have not set foot on. Nowadays, thanks to the Google Earth tool, anyone can search and explore strange and mysterious places on this planet.

14 Best New AI Features Adobe Revealed at Adobe Max 2024

14 Best New AI Features Adobe Revealed at Adobe Max 2024

Adobe Max 2024 has launched a series of exciting updates, introducing powerful new AI tools to Adobe's toolset.

Why do cats cover their faces when they sleep?

Why do cats cover their faces when they sleep?

There are many different explanations for why cats cover their faces while sleeping, from trying to keep warm to protecting their whiskers. Here's the answer to the question of why cats cover their faces while sleeping.

Quiz: How many meters is 1 foot?

Quiz: How many meters is 1 foot?

How many meters is 1 foot? If you don't know, let's find the answer together!

How many kilometers is a light year, how many earth years?

How many kilometers is a light year, how many earth years?

How many kilometers are 120 light years? How many kilometers are 40 light years? Let's find out together about a light year to find the answer!

Best time to post Instagram Reels

Best time to post Instagram Reels

The timing of your Instagram Reels can make the difference between massive engagement and dead silence. Let’s find out the best times to post on Instagram Reels.

Status about dogs, funny and humorous captions about pets

Status about dogs, funny and humorous captions about pets

There are many funny captions about dogs on the Internet. This article will gather for you the funniest, most humorous, and most interesting poems about dogs.

How to change NAT type on Windows 11/10

How to change NAT type on Windows 11/10

You will have the best gaming experience if you use Open NAT or at least Moderate NAT. That is why you need to learn how to change the NAT type.

8 Features Apple Notes Is Still Missing

8 Features Apple Notes Is Still Missing

After several updates, Apple Notes still lacks some features that could make the app even better.

4 Practical Uses of Password Managers You Didnt Know About

4 Practical Uses of Password Managers You Didnt Know About

You probably know that password managers are great for storing your online logins. But did you know they have many other great uses?

What do the heart colors on Messenger mean?

What do the heart colors on Messenger mean?

With the Messenger heart icon, you can choose different colors to use for different situations to express what you want to say to the other person.

How to Message Meta AI in WhatsApp Groups

How to Message Meta AI in WhatsApp Groups

Not only can you use Meta AI with individual WhatsApp messages, you can now send Meta AI messages in WhatsApp groups.