10 Useful Windows Networking Commands
10 Useful Windows Networking Commands
Windows has some very useful networking utilities that are accessed
from a command line (cmd console).
The networking commands are mainly used for getting system information and
troubleshooting networking problems.
1. Ping Command
The ping command is one of the most often used networking utilities for detecting devices on
a network and for troubleshooting network problems.
When you ping a device you send that device a short message, which it then sends back (the
echo).
Example
2. ipconfig Command
Another indispensable and frequently used utility that is used for finding network information
about your local machine-like IP addresses, DNS addresses etc
ipconfig /all – displays more information about the network setup on your systems including
the MAC address.
3. Hostname Command
A very simple command that displays the host name of your machine. This is much quicker
than going to the control panel>system route.
4. getmac Command
Another very simple command that shows the MAC address of your network interfaces
5. arp Command
This is used for showing the address resolution cache. This command must be used with a
command line switch arp -a is the most common.
6. NSlookup
Used for checking DNS record entries. See Using NSlookup for more details
7. Nbtstat
Diagnostic tool for troubleshooting netBIOS problems. See This technet article.
8 Net Command
9. Netstat Command
Used for displaying information about tcp and udp connections and ports. See tcp and udp
ports and sockets and how to use the netstat command
View a list of running tasks using the tasklist command and kill them by name or processor
ID using the taskKill command- See this tutorial.
Resources:
All of this is possible with the TaskKill command. First, let's cover the basics. You can kill a
process by the process ID (PID) or by image name (EXE filename).
Open up an Administrative level Command Prompt and run tasklist to see all of the running
processes:
C:\>tasklist
In the example above you can see the image name and the PID for each process. If you want
to kill the firefox process run:
or
C:\>Taskkill /PID 26356 /F
The /f flag is kills the process forcefully. Failure to use the /F flag will result in nothing
happening in some cases. One example is whenever I want to kill the explorer.exe process I
have to use the /F flag or else the process just does not terminate.
If you have multiple instances of an image open such as multiple firefox.exe processes,
running the taskkill /IM firefox.exe command will kill all instances. When you specify the
PID only the specific instane of firefox will be terminated.
The real power of taskkill are the filtering options that allow you to use the following
variables and operators.
Variables:
• STATUS
• IMAGENAME
• PID
• SESSION
• CPUTIME
• MEMUSAGE
• USERNAME
• MODULES
• SERVICES
• WINDOWTITLE
Operators:
• eq (equals)
• ne (not equal)
• gt (greater than)
• lt (less than)
• ge (greater than or equal)
• le (less than or equal)
You can use the variables and operators with the /FI filtering flag. For example, let's say you
want to end all processes that have a window title that starts with "Internet":
How about killing all processes running under the Steve account:
It is also possible to kill a process running on a remote computer with taskkill. Just run the
following to kill notepad.exe on a remote computer called SteveDesktop: