Read how to check the integrity of system files using the command line.
Find the IP address by a domain name, create a Windows shutdown shortcut, fix network connection problems and much more.
In Windows, there are some functions that you can only run from the command line (Command Prompt).
Several of them do not have a graphical interface, while others, launched in this way, simply work faster.
It doesn’t matter if you use PowerShell as a command line add-in or not; all the commands we describe in this article work the same everywhere.
Obviously, we can not cover all the teams and talk about each. Instead, we will focus on those that we think will be most useful. Even if you dislike working with the command line.
How to run a command prompt on Windows as an administrator
#1. In Windows 10:
- Click the “Start” button or select “Search” – start typing the word “cmd” in English or “Command Line” in Russian.
- A search result will appear on top, right click on the “Command Prompt” and click on the “Run as administrator” item.
#2. In Windows 8 and 8.1:
- Go to the start screen by pressing the “Windows” button on the keyboard or the “Start” button.
- At the top right, click on “Search” and start typing the word “cmd” or “Command Line.” The search result will open at the bottom.
- Click on the “Command Line” application with the right mouse button and select the “Run as administrator” option.
#3. In Windows 7:
- Click on the “Start” button, go to the “My Programs” tab – then go to “Standard.”
- Find the “Command Line” shortcut and right-click on it, select the “Run as Administrator” option.
Now let’s proceed directly to the teams.
ipconfig: Fast work with network connections
You can find your IP address and all network settings from the control panel, but this will require a few clicks. “Ipconfig” is a Windows command line utility for managing computer network interfaces.
The fastest way to find out such information as IP-addresses, the address of the main gateway, information about network connections that your computer uses, etc.
To use this utility, simply type “ipconfig” on the command line and press “Enter”.
As a result, you will see a list of all the network connections that your computer uses. Look below for the words “wireless LAN adapter” if you are connected to Wi-Fi, or “Ethernet adapter” if you are connected to a wired network.
To get more detailed information about “ipconfig,” type the command “ipconfig / all,” the result will be a list of all keys, and, the capabilities of the utility.
#4. ipconfig / flushdns: Clear-reset DNS cache
If you changed the DNS server in the network settings, this action would not take effect immediately.
Windows uses the cache that stores the received DNS responses, which saves time when you reaccess the same network resources.
For Windows to receive addresses from new DNS servers, enter the “ipconfig / flushdns” command after changing your DNS server.
With constant surfing on the Internet, your computer automatically caches IP addresses and other necessary data of the domain name service.
Clearing the DNS cache helps update this data. Outdated cached data can, over time, cause problems with the connection.
#5. ping and tracert: Troubleshooting Network Connectivity
If you have problems connecting to a local network, the Internet, or to a website, then Windows has standard tools that you can use to solve them.
“Ping” is a utility for checking the integrity of networks and the quality of connections in them based on the TCP / IP protocol.
The utility sends the so-called ICMP requests to the specified IP address or host on the network, and monitors the responses received from them.
The time between sending such a request and receiving a response to it allows you to determine the delay of packets along the route, as well as the number and frequency of loss thereof.
That is, “Ping” allows you to determine how heavily loaded the data channel is.
Enter “ping errorcodeguru.com ” » (or any other server on the Internet that you want to test), and Windows will send packets to this address.
You can enter the server name or the actual IP address of the resource. The server on this IP address will respond and report that it received them.
You will be able to see if you have lost a packet along the route and how long it took to get a response.
Also, the “ping” command has a lot of keys and information display capabilities, such as: checking communication with the specified IP address prior to manual termination.
Decrypting hostnames by IP addresses, the number and size of packets, recording the route, changing time, etc.
“Tracert” is a utility designed to track data routes in TCP / IP networks. When you enter the “tracert” command, it displays the full route of delivery of the packet, with information about each server through which it is laid.
For example, if you enter tracert errorcodeguru.com», you will receive information about each node on the way to our server with which the package interacts.
If you have problems connecting to the website, the “tracert” utility will determine at what stage the error occurred.
The “shutdown” command allows you to shut down or restart Windows from the command line. In principle, this is more useful for Windows 8, where the standard “Shutdown” button was harder to find.
This command can be used to create your own shortcuts: “Shut down,” “Restart,” “Hibernate,” etc. And place them where you want: in the Start menu, on the desktop, on the taskbar ..!
In Windows 8 and 10, you can use the dedicated computer restart button for special OS booting options.
To use the command line, just enter one of the following values (it enters all command parameters using a backslash):
- 1st “Shutdown / s / t 45” is an analogue of “Shutdown” with a delay of 45 seconds.
- 2nd “Shutdown / r / t 0” is an analogue of “Booting” .
- 3rd “Shutdown / l” – analogue “Logout / Change user . ”
- 4th “Shutdown / r / o” – restarts the computer in the Recovery Environment .
Below is an example of how to create a shortcut for shutting down in Windows 10.
- Click on any empty place on the Desktop with the right mouse button – move the cursor to “Create” – select “Label” from the dropdown menu. Immediately start the wizard to create labels.
- In the field “Specify the location of the object” we write the line “shutdown -s -t 45” (note that in this case all parameters must be specified through a hyphen, and not through a backslash), click “Next.”
- Enter the name of the shortcut in the field and click “Finish.”
- The label has been created, but it has no corresponding icon. To put it, right-click on the shortcut and select “Properties” – On the “Shortcut” tab, click on “Change Icon” – the system will display a message that “shutdown.exe” does not contain icons and the window for selecting it from the standard Windows libraries. Choose the one you like and click “Ok” twice.
- Now, the label can be placed where you want, say on the initial screen. Right-click on the shortcut – select “Secure on the initial screen. ”
#7. sfc / scannow: Check the integrity of Windows system files
“Sfc” is a standard utility for checking the integrity of Windows system files. It allows the user to find and restore the missing system files.
If the files are missing or damaged, the utility will scan them all and replace the erroneous versions of the files with the original versions.
In addition, the system file checker checks the cache directory and updates its contents.
To scan, you need to run the command prompt as an administrator, set the “sfc / scannow” command and let the program do its job.
# 8. telnet: Connecting to Telnet Servers
The “telnet” protocol client in Windows is not installed by default. But this is one of its additional features that you can install through the control panel.
After installation, you can use the “telnet” command to connect to servers without installing additional software, directly from the command line.
Just go to “Start” – “Control Panel” – “Programs and Features” – then click on “Turn Windows features on or off” – find and tick off “Telnet Client.”
cipher: permanently delete and overwrite a directory
The cipher command provides efficient encryption and decryption of files and directories on Windows. She also has an option that will overwrite the free disk space with garbage data.
This will not allow you to recover deleted files and folders using specialized software. In Windows, files deleted in the usual way remain on the disk if you are not using a solid-state drive with the Trim function.
The “cipher” command allows you to effectively “erase” all the free space on the disk without installing additional software.
For example: to clear the disk space on the F: drive, enter the command “cipher / w: F: \.” Note that there is no space between the command key (/ w 🙂 and the drive letter (F: \).
#9. netstat -an: List of network connections and ports
“Netstat” is a standard Windows command line utility that displays the status of incoming and outgoing TCP connections.
The main purpose of the utility is to search for problems in the network and determine its performance. The team has many keys and options, but the most interesting is “netstat –an”.
Because of this line, it will display a list of all open network connections, as well as the ports they use and the external IP address to which it connects them.
#10. nslookup: Find the IP address by a domain name
When you enter the name of a website in the address bar of your browser.
Your computer finds the IP address associated with this domain name and displays the result.
You can use the “nslookup” command to find out the IP addresses and the name of the servers on which it locates the domain.
For example, type “nslookup –type = any errorcodeguru.com ” » on the command line (the parameter -type = any means output all available data).
And you will see all the information about our server. You can also perform a reverse search, that is, find out the server name by IP address.
This is not a complete list of all the commands that may be useful to you. We indicated ten useful command-line utilities on Windows, and we hope that you will easily use them.
Specializing In Error Codes & Problem Solving