The CMD.exe tool (command prompt) was one of the most used in previous versions of Windows, however with time and improvements in the Microsoft operating system interface, it has caused the use of this tool to be stopped. However, the truth is that it is still very useful to carry out certain tasks.
Related: All commands for the Run tool in Windows 10, 8 and 7.
The only drawback that the Command Prompt tool presents is that we must use text commands to carry out the tasks. This means that you must memorize a large number of commands or have a list of the same always at hand for when you need it.
Well, this is what we want to show you; a list with the most popular and useful commands that can be used in the Windows 10 CMD (Command Prompt). As is evident, in order to execute the commands, we will first have to open the CMD, if you don’t know how to do it, we recommend reading the following post: How to run Command Prompts as Administrator in Windows 10, 8.1 or 7.
List of the most popular and useful commands to run in the Windows System Symbol (CMD) tool.
– Assoc: Most files in Windows are associated with a specific program that is assigned to open the file by default. Sometimes remembering these associations by heart can be tricky. However, you can do it easily thanks to the command: assoc. This command will display a complete list of file name extensions and program associations.
You can also add file formats to the command to change file associations, such as “assoc .txt =”. This will change the text file association (.txt) to whatever program you specify right after the equals sign. The “Assoc” command itself will reveal both the names of the extensions and the names of the programs, which will help you to use this command correctly with their associations.
– Cipher: It is a command that allows you to restrict access to certain files on a mechanical hard drive and the space it occupies will be shown as free. The files will remain recoverable until the system overwrites them with new data, which may take some time.
However, the Cipher command will delete the directory when adding random data. For example, to clean your C drive, you would have to use the command: “Cipher / w: c” which will erase the free space on drive C. The command does not overwrite the non-erased data so it does not delete the files you need running this command.
– Driverquery: Drivers are still one of the most important software installed on your computer. Misconfigured or missing drivers can cause all kinds of problems, so it’s good to have access to a list of what’s installed on your computer. That is exactly what the “driverquery” command does. You can extend it using for example: “driverquery -v” to get more information, including the directory where the driver is installed.
– File Compare: You can use this command to identify differences in the text of two files. It is particularly useful for writers and programmers trying to find small changes between two versions of a file. Just type “fc” and then the directory path and name of the two files you want to compare.
You can also extend the command in various ways. Type “/ b” to compare only binary output, “/ c” to ignore case-insensitivity, and “/ l” to compare only ASCII text.
So for example you could use the following:
fc /l "C:Program Files (x86)ejemplo1.doc" "C:Program Files (x86)ejemplo2.doc"
The above command compares ASCII text in two Word documents.
–Ipconfig: This command will show you the IP address that your computer is currently using. However, if you use a router (like most computers today), it will show the IP address of the router’s local network, which is the one you use to surf the internet.
Still, ipconfig is useful due to its extensions. “Ipconfig / release” followed by the use of “ipconfig / renew” to force your Windows computer to request a new IP address, which is useful if your computer displays the message that it is not available. You can also use “ipconfig / flushdns” to update your DNS address. These commands are great if the Windows network troubleshooter isn’t able to fix your lack of internet connection.
– Netstat: Using the “netstat -an” command will provide you with a list of currently open ports and related IP addresses. This command will also tell you what state the port is in: listening, established, or closed.
This is an excellent command for when you are trying to troubleshoot devices connected to your computer or when you fear that a Trojan has infected your system and you are trying to locate a malicious connection.
– ping: Sometimes you need to know whether or not packets are reaching a specific network device. That is where the ping command comes in handy.
Type “ping” followed by an IP address or web domain to send a series of test packets to the specified address. If they arrive and are returned, you will know that the device is capable of communicating with your PC; if it fails, you will know that something is blocking communication between the device and your computer. This helps you decide if the root of the problem is misconfiguration or network hardware failure.
– PathPing: This is a more advanced version of ping that is useful if there are multiple routers between your computer and the device you are testing. Like ping, you’ll use this command by typing “pathping” followed by the IP address or domain you want to trace, but unlike ping, pathping also transmits some information about the path that the test packets take.
– Tracert: The “tracert” command is similar to pathping. Once again, type “tracert” followed by the IP address or domain you want to track. You will receive information about each step on the route between your computer and the target. However, unlike routes, tracert also tracks how long (in milliseconds) each hop takes between servers or devices.
– Powercfg: It is a very powerful command to manage and track how your computer uses energy. You can use the command “powercfg hibernate on” and “powercfg hibernate off” to manage the hibernate function, and you can also use the command “powercfg / a” to view the power saving states currently available on your Windows computer.
Another useful command is “powercfg / devicequery s1_supported”, which displays a list of devices on your computer that are compatible with standby mode. When enabled, you can use these devices to wake your computer from standby, even remotely. You can enable it by selecting the device in Device Manager, opening its properties, going to the Power Management tab and then checking the box: Allow this device to activate the equipment.
“Powercfg / lastwake” will show you which device last turned on your computer from a sleep state. You can use this command to troubleshoot your PC if it seems to be waking up from sleep randomly.
You can use the command “powercfg / energy” to create a detailed report of the power consumption of your computer. The report is saved in the specified directory after the command completes. This report will inform you of any system failures that may increase power consumption as well as devices that are blocking certain sleep modes or that are misconfigured to respond to your power management settings.
– Shutdown: With this command you can turn off your computer. However, this command can be extended as for example: “shutdown / r / o”, which restarts your PC and starts the Advanced startup options menu, where you can access Safe Mode and other Windows recovery utilities. This is useful if you want to restart your computer to solve a problem.
– Systeminfo: This command will offer you a detailed description of the configuration of your equipment. The list covers your operating system and hardware. For example, you can find Windows installation date, last boot time, your BIOS version, total and available memory, installed updates, network card settings, and much more.
Use “systeminfo / s” followed by the hostname of one of the computers on your local network, to remotely obtain information from that system. This may require additional syntax elements for domain, username, and password, such as: “systeminfo / s [host_name] / or [domain] [user_name] / p [user_password]”
– System File Checker: It is the system file checker, it is an automatic analysis and repair tool that focuses on Windows system files.
You will need to run the command prompt with administrator privileges and enter the command “sfc / scannow”. If SFC finds any damaged or missing files, it will automatically replace them using cached copies saved by Windows for this purpose. The command can take up to half an hour to complete.
– Tasklist: You can use the “Tasklist” command to get a current list of all the tasks running on your PC. Although it is something that can be done with the Task Manager, the command can sometimes find tasks hidden from view in that utility.
There is also a wide range of modifiers. “Tasklist -svc” shows services related to each task, use “tasklist -v” to get more details about each task, and “tasklist -m” will locate the .dll files associated with active tasks. These commands are useful for advanced troubleshooting.
–Taskkill: The tasks that appear in the “Tasklist” command will show a process and execution ID (a four or five digit number) associated with each one of them. You can force a program to stop using “taskkill -im” followed by the executable name, or “taskkill -pid” followed by the process ID.
Other useful commands:
– nbstat: Command to find names of computers in your local network.
– netstat -ano | find “est”: With this command we will obtain a list of the processes that have established CP connections.
– tasklist | find “[process id]”: Enter this command to get the name of the executable associated with the specific process id we are interested in.
– cacls: This command is the most useful for manually accessing hidden files and folders.
– net use: To map CNC units of networked equipment.
– chkdsk / f C: Check your hard drive C: partition for errors and fix bad sectors.
– Schtasks: With this command we can schedule tasks.
Leave a Reply