DOS Command Prompt: What is It and How to Use It?

Explore easy commands to get work done on your PC quickly

by Loredana Harsana
Loredana Harsana
Loredana Harsana
Managing Editor
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... read more
Reviewed by Alex Serban
Alex Serban
Alex Serban
Windows Server & Networking Expert
After moving away from the corporate work-style, Alex has found rewards in a lifestyle of constant analysis, team coordination and pestering his colleagues. Holding an MCSA Windows Server... read more
Affiliate Disclosure
  • CMD or Command Prompt is a command line interface known as Windows Command Processor.
  • Command Prompt commands can help you perform many operations without using a mouse.
DOS COMMAND PROMPT

XINSTALL BY CLICKING THE DOWNLOAD FILE
To fix various PC problems, we recommend Restoro PC Repair Tool:
This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:

  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer's security and performance
  • Restoro has been downloaded by 0 readers this month.

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 DOS Command 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 also troubleshoot common Windows problems and 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: 

  1.  First, press the Windows key and type CMD and select Run as administrator.DOS COmmand Prompt
  2. You will get a UAC prompt; click on Yes.
  3. Now, the Command Prompt window will be open on your screen.

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:

  • First, always run the command prompt as Administrator to avoid any error.
  • Please type or paste the command as mentioned for it to work properly
  • Press Enter after every command for it to execute.

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

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 /CheckHealth DISM /Online /Cleanup-Image /ScanHealth DISM /Online /Cleanup-Image /RestoreHealth

4. Installed drivers list

To get the list of installed device drivers on your computer, you can type the following command

driverquery

5. Setup remote connection

With the below-mentioned command-line shell command, you can establish connections to remote computers 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.CD

To come out of a present directory C:\Windows\System32>cd\

To go to the following directory C:\>cd Windows\BrowserCore

7. Rename the file

REN and Rename are the same commands, and these are used interchangeably to rename a file or folder.RENAME COMMAND PROMPT

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.

Detailed power consumption report of your computer powercfg /energy

 Point out the device that woke your PC from sleep powercfg /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

10. 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 to check the drive’s file system integrity and repair the file system and problematic drive errors, this command can help you.

chkdsk

12. Manage Programs

WMICYou can get a list of installed programs on your computer and uninstall the programs you don’t need.

List of installed products wmic product get name

Expert tip:

SPONSORED

Some PC issues are hard to tackle, especially when it comes to corrupted repositories or missing Windows files. If you are having troubles fixing an error, your system may be partially broken.
We recommend installing Restoro, a tool that will scan your machine and identify what the fault is.
Click here to download and start repairing.

Uninstall a program product 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 cache ipconfig /flushdns

Register DNS again ipconfig /registerdns

Release the IP address for the specific adapter ipconfig /release

Renew the IP address for the particular adapter ipconfig /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  password netsh 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

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.File compare

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 Folder

Hide folder  Attrib +h +s +r "folder_name"

Unhide Folder Attrib -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 extensions assoc .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

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. Type osk

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. 

Still having issues? Fix them with this tool:

SPONSORED

If the advices above haven't solved your issue, your PC may experience deeper Windows problems. We recommend downloading this PC Repair tool (rated Great on TrustPilot.com) to easily address them. After installation, simply click the Start Scan button and then press on Repair All.

This article covers:Topics: