In this blog, you are going to learn how to first bring up a command console on Windows and then how to use 10 useful commands to obtain system information and troubleshoot network issues. If you are familiar with the command console, please feel free to skip the next section. If not, you can proceed to the following section that will cover how to bring up the command console.
How to Bring up a Command Console
- Type ‘cmd’ into the search bar
- Press enter and you will see the following console popping up
The 10 Most Useful Windows Command
ping
Ping is a command to send a device a message just so it will echo back. It can detect devices on a network and troubleshoot networking problems. Generally, you can ping a hostname (website) or IP address. For example, ping facebook.com or ping an IP address.
As you can see from the above screenshots, both attempts echoed back, meaning that the device is working well. If there were no replies, it could mean that the device you are pinging is disconnected or not configured correctly or you are having an issue with your computer or internet.
ipconfig
This command can find network information related to your devices such as IP address, Subnet Mask, and Default Gateway.
hostname
An easy way to show the hostname of your machine without having to go through the Control Panel. For this, you can type “hostname” directly on the console then press enter.
getmac
Another easy way to display the MAC address of your network interface. Similar to hostname, you type “getmac” directly onto the console and press enter.
arp -a
Address resolution protocol, or ARP, is a protocol used to broadcast to query the nodes on the network to send their MAC address if their IP address matches the IP address specified. When you use this command, it will display the interface, internet address, physical address, and type.
nslookup
This command is useful when it comes to troubleshooting DNS-related problems. It can be used to find specific information that you need such as the host IP address (a website) or domain name of an IP address.
nbtstat
Nbtstat has to do with troubleshooting NetBIOS name resolution problems, specifically to remove and correct preloaded entries using case-sensitive switches. It can be followed by various switches as shown below.
net
This command manages almost every aspect of a network and network settings such as network shares, network print jobs, and network users. There are many options to choose from, but you do not have to memorize them, you can display all available options by simply typing in “net” or “net /?” on the console and pressing enter (below screenshot).
netstat
The netstat command, which refers to network statistics, displays detailed information about how your device is communicating with other devices (can be computers or networks). From this command, you will learn about details such as individual network connections or both the overall and protocol-specific networking statistics that can be useful when it comes to troubleshooting. The netstat command without any option specified will display all active TCP connections, your IP address, foreign IP addresses, and their respective port numbers and TCP state.
Taskkill
This is a fancier way of killing a process on Windows computers instead of using Task Manager. This method gives you more control and you can even save time by ending multiple processes altogether. First, you bring up the list of all the processes that are currently running using the command “tasklist”
You can forcefully kill all processes or a process by referring to either their image name or PID and the /F flag, respectively. For example, you can terminate all your chrome processes by specifying the image name (/IM chrome.exe /F), The whole command can be viewed in the below screenshot.
Below is an example of how you can terminate a process by specifying its PID in the command line.