Command Prompt CMD Commands

Command Prompt Commands: There are approx. 280 CMD Commands available in Command Prompt.

Command Prompt is one of the most useful tool in Windows Operating System.

It helps you in accessing all the important features and functionality of the Windows Operating System with the help of command line interface.

It also increases your knowledge related to the working of a Computer.

If we compare Windows and Linux, then there are very limited things that you can do with Windows CLI as compared to Linux CLI(Linux Commands).

Still CMD Commands are very useful as there are some tasks which you can perform using Command Prompt only.

So, here are the Top 16 CMD Commands every Windows user must know:

1. Assoc

Assoc is one of the most useful command prompt commands, which helps in listing all the files associations.

So, when you will type “assoc” in your command prompt, as a result you will get all the file extensions(.txt, .mp3, .exe) and associated programs to open those files.

command prompt - assoc command

For example – to open a file with .ppt extension, a program named “PowerPoint” is used. As a result, you will see the following list.

assoc command

With the help of assoc command, you can also change the program associated with a particular file extension.

For example – by typing “assoc .txt=” followed by any program name(Ex- word). You can change the program associated with the .txt file extension.

As a result, .txt is now associated with the program named “Word”.

cmd assoc command.

Make sure to open the command prompt as administrator by right clicking on command prompt and choosing the “Run as administrator” option.

2. Chkdsk

Chkdsk stands for Check Disk. It is a command which is used for checking any type of error or malfunctioning in the disk and resolve or recover it if possible.

For example – you can use the command, “chkdsk /f ” followed by the disk name(C: , D: or E:) to scan that particular disk.

command prompt - chkdsk command

Make sure to open the command prompt as administrator by right clicking on command prompt and choosing the “Run as administrator” option.

3. Cipher

Cipher as the name suggests is used to encrypt the deleted files or data in your computer.

Whenever you delete any data or file in your computer. You get an empty or free space in your disk.

However, the deleted files are not completely removed from your computer and can be recovered whenever you want, until any other data is over overwritten to it.

So, if you want to permanently delete that data or make the deleted data unrecoverable. Then you can use the cipher command to do so.

For example – by typing “cipher /w:E:\” you can make the deleted data of drive E unrecoverable by overwriting it with the random data.

cmd - cipher command

This command will not affect the undeleted data. It will only affect or overwrite the deleted data of the drive.

4. Color

Color command is used to change the background as well as foreground color of the command prompt window.

The syntax to use the color command is “color BGColor FGColor”, where BGColor stands for the Background Color and FGColor represent Foreground Color.

There is a list of different color associated with the different hexadecimal number.

For example – If you type in “color 0b”, you will get the background as black color and foreground as aqua blue color, because here 0 represents black color and b represents aqua blue color.

command prompt - color command

Similarly, you can try the different combinations of hexadecimal numbers accordingly.

5. Driverquery

Drivers are the set of software’s which are very useful and important for the proper functioning of a computer.

For example – Graphic driver is used for handling the graphics of your computer.

Driverquery is a command which is used for accessing the complete list of all the drivers installed on your computer.

So, all you have to do is just type “driverquery” in your command prompt and you will get the list of all the driver in your PC.

command prompt - driverquery command

If you want to get more details like – the location of directories where these drivers are installed.

driver query - v command

Then you can use the command “driverquery -v” to do so.

6. File Compare

FC is a CMD Command which is used for comparing 2 different files.

So, if you want to compare the text between two files named file1.txt and file2.txt. Then you can do so with the help of fc command.

All you have to do is just type “fc file1_location file2_location”.

file compare fc command

You can also enhace the functionality by adding the attribute like – “/a” to perform the ascii text comparison and “/b” to perform the binary comparison.

7. Ipconfig

Ipconfig is very useful command if you want to perform network troubleshooting or you just want to access the information about your network, like – IP address, Subnet mask and Default gateway.

command prompt - ipconfig command

However, if you want to access more information, then you can use ipconfig/all command.

ipconfig command

8. Netstat

Netstat stands for Network Statistics. Netstat command is used for displaying the activities or details of your network connection.

So, you can type “netstat” in your command prompt and you will get all the details about the active tcp connection and ports, their IP address and the state of the ports.

cmd - netstat command

It is also useful if you want to detect malware or you want to find that whether your computer is connected to a malicious connection over the Internet or not.

9. Nslookup

Nslookup stands for Nameserver Lookup. It is a command which is used for accessing the information like – IP address, Nameserver and many more, just with the help of domain name of a website.

So, all you need to have is the domain name of the website and you can access the associated data with it.

For example – if you type “nslookup ” followed by the domain name of a website (thecoderpedia.com).

command prompt - nslookup command

You will get the information (IP address, nameserver) associated with the website.

10. Ping

Ping is one of the most useful command in networking. It helps you in testing and analyzing the connection of your computer with any other computer or server in a network.

Basically, it checks whether your computer has successfully connected to a particular server or not, by sending and receiving the series of packets from your computer to another computer or server.

For example – you can type in “ping” followed by the domain name or IP address of any website (thecoderpedia.com).

cmd - ping command

It will analyze your connection with that website (thecoderpedia.com).

11. Powercfg

If you are facing any issue related to battery or power consumption of your computer, then powercfg command is for you.

This command will let you track the battery usage of your computer, by giving a complete report of power consumption of computer and shows the possible errors or issues.

All you have to do is just type in “powercfg /energy”.

As a result, it will generate energy-report.html file for you which you can use to see the details about the power consumption in your computer.

powercfg command

Make sure to open the command prompt as administrator by right clicking on command prompt and choosing the “Run as administrator” option.

12. System File Checker

It is very useful command as it helps in scanning your system files.

It checks for the errors in the system and resolve it as well.

The syntax to use this command is “sfc /scannow” and it will start the scanning process.

System File Scan - sfc command

Make sure to open the command prompt as administrator by right clicking on command prompt and choosing the “Run as administrator” option.

13. Shutdown

Shutdown command as the name suggest, is used to shutdown your computer.

If you are a command prompt lover, then this a command which you should use to shutdown your computer.

To do so, you have to type in “shutdown /s”.

shutdown command

As a result, your computer will get turned off.

14. Systeminfo

This command is very useful if you want to know the complete information about your computer.

You just have to type in “systeminfo” in the command prompt.

cmd - systeminfo command

It will shows you the complete hardware as well as software configuration of your computer.

15. Tasklist

Most of us use task manager to see the list of all the task running in the background of our computer.

However, you can see those tasks in command prompt as well. All you have to do is just type “tasklist” in your command prompt.

command prompt - tasklist command

It will show you the list of all the tasks running in the background of your computer.

The advantage of using this command over task manager is that tasklist command shows you the hidden process as well.

16. Taskkill

Taskkill is a command which is used for killing the processes or tasks which are running in the background of your computer.

You can use the tasklist command to see the list of processes and then use the taskkill command to kill those processes accordingly.

The syntax to use Taskkill command is “taskkill -pid ” followed by the process id of that particular process.

command prompt - taskkill command

You can access the process id of any process with the help of tasklist command.

Hope you like the article. If you have any suggestion or other Command Prompt Commands which should be in this list, let us know in the comment section below.

Subscribe to the CoderPedia Blog

Get free Programming & Software Development Tips and Resources.