Most Useful CMD Commands in Windows - GeeksforGeeks

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
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.
Syntax:
prompt name_that_you_want
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.
Syntax: 
title name_that_you_want
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. 
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”.
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.  
Syntax: 
attrib +h +s +r filename
Note: Use “attrib -h -s -r file name ” to unhide the file.
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).
Battery report generated
Check out this detailed article checking laptop’s battery health.
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
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
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.
tree
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.
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
To delete DNS cache type ipconfig /flushdns and  your incognito history will be 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
user282
Technical Scripter 2020
GBlog
Technical Scripter
TechTips
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
DSA Sheet by Love Babbar
Top 10 Projects For Beginners To Practice HTML and CSS Skills
Types of Software Testing
Working with csv files in Python
How to Start Learning DSA?
How to Find the Wi-Fi Password Using CMD in Windows?
Docker - COPY Instruction
Top Programming Languages for Android App Development
How to Run a Python Script using Docker?
Setting up the environment in Java