A few years back, in the early days of computing, there were no graphical interfaces as we know them and the command line was king. Luckily for us, those days are now over and we can achieve anything we wish through mouse clicking on the GUI.
Most Windows options are accessible to the user through various menus. However, it may be useful to know certain commands allowing quick access to the various parameters of the operating system, in particular via the " Execute or by throwing them inside a Windows command prompt (CMD).
However, any advanced user wishing to control his computer a little bit and perform certain sometimes complex actions of " debugging » of software, custom installations, or Windows repair must know and know how to use these few command prompt commands (CMD).
Let's review them together.
1 . ipconfig
Ipconfig is the most used command whenever you want know your IP address locale and the network configuration of our machine.
One of the most used series of commands is the " ipconfig / release " followed by “ipconfig /renew » that you have to type in the command prompt (CMD).
These commands will allow you to force your Windows PC to release the DNS configuration of your network card and renew your local IP address, which is useful when your computer shows you a " limited connection or if you have a problem connecting to the internet.
Order entry netstat -an will provide you with a list of currently open ports and associated IP addresses. It is useful for knowing the state the listening port is in, which can be in a "listening", "established" or "closed" state.
This command comes in handy if you're trying to troubleshoot devices connected to your PC or when you're concerned that a Trojan or virus has infected your computer and created connections to unknown servers.
There is also a free and specialized linux distribution, called Kali Linux, which you can install in a virtual machine and offers you many commands and applications dedicated to security.
To understand more fully how the TCP/IP layer on which the Internet Protocol is based, you can follow a tutorial on TCP/IP networks which will teach you the essential concepts of how networks and the Internet work.
In the series of network-related CMD command prompt commands, one of the best known and of course the “ping” command.
How do you know if you can successfully reach a website or a certain application? The easiest way is to write in your command prompt " ping funinformatique.com " for example or directly the ip address like this: " ping 22.214.171.124 ».
If you can't get a response like " Response from 126.96.36.199: bytes=32 time=28ms TTL=103 that there is a communication problem.
There are also other settings that you can find by just typing " ping ».
PathPing is a command very similar to "ping", but this time it allows you to obtain the list of routers between your computer and your target.
It is used by simply typing " pathping google.fr or your IP instead of the domain name “google.fr”.
Tracert is very similar to "pathping" except that it adds the possibility of obtaining the response times (in milliseconds) that each hop between the routers takes, which can be very useful to see when the connection fails or is slowed down.
6. File Compare (fc)
Wondering how to quickly compare and identify differences between two files? The command fc is the one you need!
Just type fc in your windows command prompt (CMD) then the directory path and filename of the two files you want to compare.
Example of use :
- /l is a parameter to compare only ASCII text.
- /b will only compare the binary output.
- /c will not take case into account.
Most files on your computer are associated with a specific program that will launch when you click on a file to open it. For example, by clicking on “myfile.pdf” you will normally open your PDF file with the Windows viewer or the Adobe Acrobat Reader if you have configured it that way.
The command Assoc will allow you to list all the file associations present on your computer and their default program.
You can extend the command to change file associations. For example, assoc.txt= will change the file association for text files with the program you enter after the equals sign.
However in Windows 10, there is a more user-friendly interface that also lets you change file type associations with just a few clicks.
For this, go to Settings (Shortcut Windows key + i )> Applications>Default applications>Choose the default application you want to use for a file type.
powercfg is a very powerful command to manage and track your computer's power consumption.
Start a Windows command prompt (CMD) in Administrator mode and type " powercfg / a to bring up the list of different power management modes available on your computer.
You can use the command " powercfg hibernate on » and " powercfg hibernate off to manage hibernation.
Another very useful command is “ powercfg / devicequery s1_supported button, it allows you to display the list of devices on your computer that support connected standby. When enabled, you can use these devices to wake your computer from sleep mode, even remotely.
Knowing the list is therefore useful.
To activate a device afterwards, you can go to " Device Manager ", open its properties, go to the " Power management ", then by checking the box " Allow this device to wake up the computer ».
The command " powercfg / lastwake will show you which device last woke up your pc when it was in sleep state. Useful for troubleshooting your computer if it seems to wake up randomly.
Do you want to know if your Windows computer has energy efficiency issues?
Run the command " powercfg / energy », this will start the analysis of your computer and give you a small report available at the address indicated in the command prompt, as in this screenshot:
In order to know the detailed hardware configuration of your computer as well as the software information concerning the version of Windows 10 installed as well as the patches or the configuration of the network cards, then you can use the command " systeminfo ».
You can even search for information on a computer on your local network with the command:
Have you had any problems on your computer lately?
Use the command " sfc in Administrator mode to verify the integrity of files on your system.
The tool will scan all Windows files to find errors and attempt an automatic repair.
To run it, type “sfc /scannow with administrator privileges.
If the tool finds any corrupted files, it will automatically replace them using a copy kept cached by Windows for this purpose.
If your computer is not very powerful, running this command will take some time.
Benefit from powerful linux commands on Windows
As a bonus, did you know that you can get and use linux commands in windows 10, such as the command “ find "," grep "," Black "," cat "Or" split »?
For this, there are two methods, one where you can use the WSL2 which will be covered in a future tutorial, and one by installing small binaries, called “ UnxUtils ».
- Download UnxUtils here.
- Unzip the .zip file and copy the complete folder in for example " C:\UnxUtils »
- Type " Environment variables in Windows search and open the system environment variables panel.
- Add the address (C:\UnxUtils\usr\local\wbin)to the folder UnxUtils in the user environment variables by first clicking on " Path "And then" Edit », Then click on« New ».
- Save and restart the computer.
You now have access to many linux commands such as " find " or " grep allowing you to perform sorting or other actions on files.