The most used CMD commands you should know
Babak Varasteh
Entrepreneur | Network infrastructure design | Using the modern infrastructure technologies, we make sure the network work flawlessly and there are no obstacles to your company's growth | CEO at Arshia Faraz Co.
Command Prompt is still one of the great Windows tools. Here we take a look at the most used CMD commands that every Windows user should know:
1- Assoc
Most files in Windows are associated with a specific program and are opened by default with that program. Often times, remembering these connections can be confusing. If you have such a problem, you can enter the Assoc command to display a complete list of filename extensions and their associated programs.
You can even change file associations with programs with this command. For example, the command =Assoc. txt changes the association of text or text files to whatever program you put after the "=" sign. The Assoc command reveals both extension names and program names.
In Windows 10, you can quickly change file associations with different programs using a more user-friendly interface. To do this, go to Settings (Windows + I) > Apps > Default apps > Choose default app by file type.
2- Cipher
Deleting files on a mechanical hard drive does not delete them completely. In fact, a label will be placed on those files that you think you have deleted, saying that the file or files are no longer available and the space they occupy will be freed. Files will still be recoverable until the system overwrites them with new data, which can take time.
However, the Cipher command erases a path or directory by accidentally writing data to it. For example, to erase the C drive, use the cipher /w:d command. By running it, free or empty space on the drive will be erased. Of course, this command does not write anything on the undeleted data, so by executing this command, you will not delete the files you need.
3- Driverquery
Drivers are still among the most important software installed on a computer. Improperly configured, missing, or even outdated drivers can cause just about any problem you can think of. So it's better to have access to a list of all those things you have on your computer.
This is exactly what Driverquery does. You can even run this command as driverquery -v to get more information.
4- File Compare
You can identify the differences in the text between two files with this command. This command is mostly used for programmers to find small changes between two versions of the same file. Just type the command as fc along with the directory path and the file name of the two files you want to compare.
You can run this command in several different ways to get more information. If you type with b/ only the binary output will be compared, if you use i/ only the ASCII text will be compared.
?? For example, you can use it as follows:
fc /l "C:\Program Files (x86)\example1.doc" "C:\Program Files (x86)\example2.doc"
The above command compares the shell text in two Word files.
5- Ipconfig
This command displays the IP address that your computer is currently using. If you are using a router, you will see the router's local network address.
Ipconfig command is very useful because of its extensions. First ipconfig /release followed by ipconfig /renew forces the computer to request a new IP address, this is for when the computer claims one is unavailable. To refresh the DNS, you can use the command in the form of ipconfig /flushdns.
6- Netstat
Entering the netstat -an command displays a list of currently open ports and their IP addresses. It even tells you what the status of the port is, whether it is listening, up or down.
This command is very useful when you are trying to find the problem of devices connected to the computer or you are afraid that a Trojan has infected your system and you are trying to identify the malicious connection.
7- Ping
Sometimes you need to know whether packets reach a certain device on the network or not. This is where Ping comes in handy.
Type ping with the IP address or web address to send a series of test packets to the specified address. If they reach the destination and are returned again, it means that the device is able to communicate with the router. But if they don't reach the destination, then you realize that something is in the way of communication between the device and the computer.
领英推荐
8- Pathping
This command is a more advanced version of the Ping command. If there are multiple routers between your computer and the device you are testing, you can use Pathping. Just type it in with the IP address, but unlike ping, it displays information about the path the test packets took.
9- Tracert
This command is similar to pathping. Type it along with your desired IP address or domain. You will receive information about every step of the way between your computer and the destination. However, the difference between tracert and pathping is that tracert tracks the time between each hop between servers or devices in milliseconds.
10- Shutdown
Shutdown command used to shut down the system.
With the shutdown /r /o command, the computer will restart and show the Advanced Start Options menu.
11- Systeminfo
This command gives a detailed report of your computer configuration. The list includes operating system and hardware. For example, you can see the exact date of Windows installation, the time of the last system boot, BIOS version, total and available memory, installed patches, network card settings, etc.
Use the systeminfo /s command along with the hostname of the computer or local network to get information about that system remotely. Of course, you may need to enter some additional keys for domain, username and password:
systeminfo /s [host_name] /u [domain]\[user_name] /p [user_password]
12 - System File Checker (sfc)
This command runs an automatic scan and repair tool that checks for Windows system files.
You must have administrator privileges to execute this command. Enter the sfc /scannow command. If it succeeds in finding corrupted or missing files, it will automatically replace them with cached copies kept by Windows just for this purpose.
13- Tasklist
If you want to get a list of everything running on your computer, use the tasklist command.
If you use the command as Tasklist -svc, the services related to each task will be displayed, Tasklist -v will show more details on each task. tasklist -m lists the DLL files associated with each active task. These commands are very useful for advanced troubleshooting.
14- Chkdsk
Windows automatically marks the drive for a chkdsk scan when there are indications that the local drive has bad sectors, missing clusters, or other physical or logical errors.
If you think the hard drive is getting damaged, you can start the scan yourself. The most basic command is chkdsk c : which quickly scans the C drive without having to restart the computer. If you use parameters such as /f or /r or /x or /b as chkdsk /f /r /x /b c, chkdsk will repair all errors, restore data, or clear the list of bad sectors.
About me: +20 years of experience as IT Project manager and total Network solution designer focused on Infrastructure solutions on medium to large scale networks and complex infrastructures. A collaborative person that enjoy communicating with the team and looking for new IT challenges. I am ready to accept new challenging opportunities.
? Connect me easy via?[email protected].