Share this article
Improve this guide
What is a (DOS) Command Prompt & How to Run it in CMD?
Explore easy commands to get work done on your PC quickly
6 min. read
Updated onOctober 4, 2023
updated onOctober 4, 2023
Share this article
Improve this guide
Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more
Key notes
Command Prompt is popular among normal users as well as professionals. It is a great way to complete your mundane tasks on the computer. It can run several commands, automate your tasks, and allow you to operate your PC via commands.
This guide will talk about DOSCommand Prompt, how to use it, and the most popular commands you must know. Let’s begin!
What is DOS Command Prompt?
Command Prompt is a command-line interface in Windows computers that lets you control your computer via text commands. Most of the text commands automate tasks using batch files and scripts. These commands can alsotroubleshoot common Windows problemsand perform advanced administrative functions.
Command Prompt is often called MS-DOS or the DOS prompt, but it is incorrect. Command Prompt is a program replicating command line abilities in MS-DOS but can’t be referred to as DOS.
How can I use Command Prompt?
You can use Command Prompt for various tasks, including checking and repairing system errors, moving a file, removing viruses, and creating a bootable media drive. All you need to do is fire up Command Prompt, type in the correct command, and press Enter to execute it.
To access Command Prompt, follow these steps:
What are the most used commands on Command Prompt?
Before going through the popular command line utilities, make sure you keep these things in mind:
Let’s check out some of the most used and helpful commands that you can keep handy:
1. Ping
To check whether there is network connectivity and reachability on your device, you can type the following command:
ping (website address)
2. System File Checker
SFC scan is a scan and repair tool that scans your computer for corrupt or missing files. Also, it replaces the damaged files with cached copies saved by the computer.
sfc/scannow
3. DISM
Deployment Image Servicing and Management fixes damaged or corrupted Windows operating system files and features directly via Windows online servers.
DISM /Online /Cleanup-Image /CheckHealthDISM /Online /Cleanup-Image /ScanHealthDISM /Online /Cleanup-Image /RestoreHealth
4. Installed drivers list
To get the list ofinstalled device driverson your computer, you can type the following command
driverquery
5. Setup remote connection
With the below-mentioned command-line shell command, you can establishconnections to remotecomputers or remote desktop session host servers.mstsc /v:192.168.122.20
To launch and edit the RDP configuration file hostconnection.rdp, type this command:mstsc /edit hostconnection.rdp
6. Change the Directory
The command, when executed, helps you change the current working directory. In other words, with this, you can navigate to another folder on your computer.
To come out of a present directoryC:\Windows\System32>cd\
To go to the following directoryC:>cd Windows\BrowserCore
7. Rename the file
REN and Rename are the same commands, and these are used interchangeably torename a fileor folder.
ren “original_filename.ext” “new_filename.ext”
8. Power Configuration
The command shows your computer’s power settings. It helps you manage and track the way your PC uses energy.
Detailedpower consumptionreport of your computerpowercfg /energy
Point out the device that woke your PC from sleeppowercfg /lastwake
9. Boot in troubleshooting mode
This command can restart your PC and take you to the Advanced Start Options menu for troubleshooting.
shutdown/ r/o
- System Information
If you want to know the system-related information, including OS, network card, System model, type, hostname, processor, etc., use this command:
systeminfo
11. Check Disk
If you want tocheck the drive’s file system integrityand repair the file system and problematic drive errors, this command can help you.
chkdsk
12. Manage Programs
You can get a list of installed programs on your computer anduninstall the programsyou don’t need.
List of installed productswmicproduct get name
Uninstall a programproduct where name=“Appname” call uninstall /nointeractive
13. Restore Network Settings
In case there is a network connection issue and you want to troubleshoot the network. These commands can help:
ipconfig
Clears all the IP addresses from the cacheipconfig /flushdns
Register DNS againipconfig /registerdns
Release the IP address for the specific adapteripconfig /release
Renew the IP address for the particular adapteripconfig /renew
14. Check Wi-Fi Password
This command helps you check the password for your wired or wireless connections.
Replace SSID with your Wi-Fi name to get your Wi-Fi passwordnetsh wlan show profile SSID key=clear
15. Delete Temp files
This command helps you retrieve space on your computer by removing temporary files.
del /q /f /s %temp%*
del /s /q C:\Windows\temp*
16. Close Tasks
This command can be used to force stop a program or process. Replace executablename with the program or process name you want to kill.
taskkill /IM executablename
17. Compare Files
If you want to compare a file via its content and see the modifications made over time. Replace File 1 and File 2 with the actual file’s name.
FC File 1.txt File 2.txt
18. List of Tasks
It shows the tasks running on your PC.
Tasklist
19. Network Statistics
It shows you all the details of the active TCP connections.
NETSTAT
20. Hide/Unhide your folders
With this command, you can hide your important folders, and CMD can only reaccess these hidden folders.
Hide folderAttrib +h +s +r “folder_name”
Unhide FolderAttrib -h -s -r “folder_name”
21. View or Modify File Extensions
This command shows you the file format and extensions of all files on your computer.
Assoc
Modify the extensionsassoc .txt=.pdf
22. Cipher: Delete Data Permanently
This command permanently wipes the data on a drive by writing random data. To do so, type the following command. Instead of C, type the desired drive.
cipher/w:c
23. Memory Diagnostic tool
If there is a problem with your RAM, you can run Windows Memory Diagnostic tool. Type the command mentioned and follow the on-screen instructions.
Mdsched
24. Virtual Keyboard
If you want to open the on-screen keyboard. Typeosk
25. System Restore
With the command mentioned, you can launch the backup and restore the window to either create a backup or restore from the backup.
rstrui.exe
That’s it! These are some of the most useful DOS command prompt commands you can use to troubleshoot or perform daily tasks on your computer.
Feel free to let us know your most used command on the command prompt in the comments section below.
Loredana Harsana
Windows Software Expert
Loredana is a passionate writer with a keen interest in PC software and technology. She started off writing about mobile phones back when Samsung Galaxy S II was on top of the world and she fell in love with tech of all sorts.
Whenever she’s not at her work desk, you’ll find her enjoying refreshing tea flavors, spilling stories on paper, and listening to the radio.
User forum
0 messages
Sort by:LatestOldestMost Votes
Comment*
Name*
Email*
Commenting as.Not you?
Save information for future comments
Comment
Δ
Loredana Harsana
Windows Software Expert
Loredana is a tech enthusiast who tackles mobility, privacy, and networking in easy-to follow guides for everyone.