Skip to content
Related Articles

Related Articles

Most Useful CMD Commands in Windows

View Discussion
Improve Article
Save Article
  • Difficulty Level : Hard
  • Last Updated : 31 Aug, 2021

CMD Commands are the most preferred way of doing anything to computer experts and coders. Today we’re going to learn some useful commands that make our work easy and productive.

Most Useful CMD Commands in Windows

Most Useful CMD Commands in Windows

1. Prompt Command

Usually, when we open our command prompt, we see in the left corner path of the current directory is written. So now we want to change it to our wish. Here Prompt command is used.


prompt name_that_you_want

2. Title Command

Similarly, like prompt, when we open command prompt, the title of the application is like “C:\WINDOWS\system32\cmd.exe” is written. If we want to change it, then we use the title command.


title name_that_you_want

3. Color Command

When we see hackers in movies, having some green codes moving very fast on their computer screen, we get fascinated. Maybe you’ve got bored while working on a black and white screen. Then you can use the color command.

It requires two Hexadecimal digits. First for background and second for the foreground. 

Example: color 02 makes it green text and black background. 

4. Opening CMD Shortcut

There are many ways to open command prompt in windows. One we’re going to discuss today is, to open CMD in any folder. Yes, we’ll open it in any folder. Simply go to the address bar of that folder type “cmd” and hit “enter”.

5.  Hide Folders  

When we hide any folder going from its properties, it gets showed as we check “Show hidden files” and the same thing happens when we use “attrib +h filename”. So now we are going to see a command that will hide your folder and there’s no any way to find it out again by others instead of you.  


attrib +h +s +r filename

Note: Use “attrib -h -s -r file name ” to unhide the file.

6. Check your laptop’s battery health

So, the first command is for checking the battery health of the laptop. The command prompt will give you brief information and technical details about your laptop’s battery. To view a battery report, open a command prompt as an administrator and run the following command:

powercfg /batteryreport /output “C:\battery_report.html”

After hitting the enter key, your laptop’s battery report will be saved in your specified route in html format. (here we have given the path of the C drive).

laptop's battery report

Battery report generated

Check out this detailed article checking laptop’s battery health.

7. Scan for system problems

With Windows command prompt, you can check all system files for any system problems like file corruption within a single command. Just open a command prompt in administrative mode and type:

sfc /scannow

This command will scan all protected system files, and replace corrupted files with a cached copy that is located in a compressed folder at %WinDir%\System32\dllcache. This process will take some time, so don’t close command prompt until verification gets completed.

Scan for system problems

Scan for system problems

8. View your Windows license key

Sometimes you need to transfer your Windows 10 license to a new computer. At that time, your Windows product license key is very important. Let’s see how you can get your windows license key using a command prompt. As earlier, open a command prompt in administrative mode and after typing the command mentioned below, press the enter key.

wmic path softwarelicensingservice get OA3xOriginalProductKey

Windows license key

Windows license key

9. Save folder trees to disk

Sometimes you can’t find an overview of all the nested folders on a drive and get confused about the location of a particular folder. In this situation, the command line helps you out. It will give you a tree-like representation of all the nested folders in that directory. Type this command and after pressing enter you’ll see the pictorial representation of all the folders.


Overview of all the nested folders on a drive

Overview of all the nested folders on a drive

You can also add “> c:\export.txt” after tree, to save the results in a text file that you can browse in your local storage.

All the folders list is saved to the C drive.

All the folders list is saved to the C drive.

10. View and delete Incognito history

You might know that your computer has a Domain Name System (DNS) which converts the site URL that you type in the browser address bar into an IP address equivalent to that site. So your Incognito history also gets saved in a DNS cache, sometimes referred to as a DNS resolver cache.

  • To view DNS cache type ipconfig /displaydns in the command line, and press enter and you will see all the sites with their IP addresses.
DNS Cache consisting list of websites and their IP Addresses

DNS Cache consisting list of websites and their IP Addresses

  • To delete DNS cache type ipconfig /flushdns and  your incognito history will be cleared.
DNS Cache cleared

DNS Cache cleared

You can also checkout our detailed article about How to Check Incognito History and Delete it.

So these are five command tricks you need to know. Hope you find value from it. For more about such command tricks, visit this article about Useful CMD commands for daily use in Windows OS

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!