The Windows command prompt has been an integral feature of the Windows operating system for a very long time. Some CMD commands are so useful and easy to use that even inexperienced users consider the Windows command prompt to be a vital component of the operating system. It is frequently rumoured that it may be phased away at some point, but this is unlikely to occur in the near future. Here are 12 of the most useful CMD commands to know if you desire greater control over your Windows computer.
12 Best CMD Commands Every Windows User Should Know
1. FC: File Compare
It can be difficult to remember what the differences between versions were when files are modified over time. You may not think that a CMD command may compare files and show all differences, but it is true.
The FC command compares two files, either ASCII or binary, and returns a list of differences discovered.
1-/a Fc File1.txt File2.txt will compare two ASCII files.
2- Fc /b A binary comparison of two photos, Picture1.jpg and Picture2.jpg, will be performed.
2. ASSOC: Fix File Associations
One of the most powerful tools in the CMD command suite is the ASSOC command.
Some file extensions are linked to specific apps on your computer. When you double-click a PDF file, for example, your computer knows to open Adobe, and when you double-click a DOC file, it knows to open Microsoft Word.
Commands in CMD You can view all of the file associations that your computer is aware of by typing ASSOC in the command window. You’ll also see the file extension and the programme with which it’s related.
To alter the association, enter assoc.doc=Word.Document.8.
3. NETSTAT: Network Statistics
Are you concerned that malware is running on your computer and connecting to the internet without your knowledge?
You may receive a list of all active TCP connections from your computer by running the NETSTAT command from the command prompt.
4. IPCONFIG: IP Configuration
Network troubleshooting is never easy, but IPCONFIG is a command that greatly simplifies the process.
When typed into the CMD command prompt, this command displays precise information about your current network adapter connection, including:
1- Current Internet Protocol Address
2- Mask of the Subnet
3- Default Gateway IP Address
4- The current domain
This information can help you troubleshoot router problems and other network adapter connectivity problems.
5. TRACERT: Trace Route
TRACERT is a fascinating Windows Command to use. If you’ve ever wondered how your internet traffic gets from your browser to a remote system, such as Google servers, TRACERT can tell you.
The traceroute command delivers packets to a distant destination (server or website) and returns the following information:
1- The number of hops (intermediate servers) required to reach the target.
2- Time required to travel to each hop
3- Each hop’s IP address and sometimes its name
TRACERT can show you how your internet requests’ pathways alter based on where you connect to the internet. It also aids in the diagnosis of a faulty router or switch on a local network.
Also See: 12 Best Source Code Editor To Try
6. PING: Send Test Packets
The PING command is the best companion of an IT analyst. This command transmits test packets over the network to the specified system.
Well, you can use the PING command to see whether your computer can connect to another computer, a server, or a website. It can aid in network disconnection detection. In addition, it provides the packet transit time in milliseconds, which is indicative of a poor network connection.
7. SHUTDOWN: Turn Off Computer
The SHUTDOWN command is a versatile command that allows you to manage the computer’s behaviour when shutting it down. For instance, after applying updates to a computer system, it is frequently utilised as a scheduled operation or as part of an IT batch job.
Well, entering shutdown /i at the command prompt will restart a shutdown, but it relies on a graphical user interface to give the user the option of restarting or performing a complete shutdown. If you do not want the graphical user interface to appear, use the shutdown /s command.
There is a vast list of additional parameters that can be used to log off, hibernate, restart, etc. To view all of them, type shutdown with no arguments.
8. POWERCFG: Power Configuration
Are you frustrated by your laptop’s apparent power consumption? It is conceivable that your power settings are optimised for maximum efficiency. Well, the POWERCFG (power configuration) Windows CMD command can be handy. To acquire a comprehensive report on energy efficiency, open a command prompt as an administrator and execute powercfg – energy.
The process can take up to a minute, but once complete, you’ll be able to check if there are any warnings or errors that can help you improve the power efficiency of your system.
View the energy-report.html file for additional information regarding the errors and warnings.
9. SFC: System File Checker
If you believe that a virus or other software has corrupted the core system files on your computer, there is a Windows command that can scan the integrity of these files.
You must execute CMD as administrator (right-click and choose Run as Administrator). SFC /SCANNOW ensures the integrity of all system files that are protected. If a problem is detected, the files will be repaired using system files that have been previously backed up.
Additionally, the SFC command allows you to:
1- /VERIFYONLY: Verify the integrity of the files but do not repair them.
2- /SCANFILE: Scan the integrity of particular files and repair them if they are corrupted.
3- /VERIFYFILE: Verify the integrity of particular files without repairing them.
4- Utilize /OFFBOOTDIR to rebuild an offline boot directory.
5- /OFFWINDIR: Repair an offline Windows directory with this switch.
6- /OFFLOGFILE: Specify a location to store scan findings to a log file.
Allow up to ten or fifteen minutes for the scan, which can give as long as that.
10. SYSTEMINFO: System Information
The SYSTEMINFO command can provide the manufacturer of your network card, CPU specifications, and the exact Windows operating system version.
This command queries the system and retrieves the most vital system information. The information is presented in an easy-to-read way.
11. CHKDSK: Check Disk
The SFC command only examines the integrity of core system files, but the CHKDSK command can scan an entire drive.Open a command window as an administrator and run CHKDSK /f C: in order to check the C: drive and fix any errors.
This command searches for the following:
- File fragmentation
- Disk errors
- Poor sectors
Additionally, the command can repair any disc errors (if possible). When the command completes, the status of the scan and the actions made will be displayed.
12. NET USE: Map Drives
Open File Explorer, right-click This PC, and select the Map Network Drive wizard if you wish to map a new drive. Using the NET USE command, you may accomplish the same thing with a single command string.
For instance, if you have a shared folder named OTHER-COMPUTERSHARE on a computer on your network, you can map it as your own Z: drive by using the following command:
:- Internet use Z: “OTHER-COMPUTER SHARE” / persistent:yes
The persistent switch instructs the computer to remap the specified drive each time you log in.