As a system administrator, the Windows command prompt can help you get more information about computers and run automatic commands on multiple computers at once to complete tasks remotely. Whether you want complete information about connected networks, fix file errors, get info about hardware components, or manage volume drives, you can do it all via command prompt. If you are new to using command prompt as a system admin, then I can give you a boost to get started. Although there are hundreds of commands, in this post, I will list some of the most useful ones that system admins commonly use.
How to access command prompt in Windows?
You first need to know how to access the command prompt and run commands in it. The easiest way to do this is by using the Run command. Press Windows+R keys to open the Run dialog and type cmd in it to launch the command prompt. You can then type the commands I have mentioned below and press Enter key to execute them.
For some commands that interfere with system files and components, you might have to launch the command prompt as administrator. To do so, simply search for cmd in the Windows search box and right-click on the command prompt app, and select Run as administrator.
Now that you know how to access the command prompt and use commands, let’s see 15 Windows command prompt commands that will help you as a system admin.
ipconfig/all
Whether you need to fix connection errors or create a remote connection with other PCs, ipconfig/all command is your best friend. This command will show all the network configuration values in one place. This includes hostname, IP address, default gateway, subnet mask, network features, and much more.
How to use ipconfig/all command and its parameters
Tracert
If the computers you are administrating are a part of a large network and connected via multiple routers or bridges, the tracert command can help find network issues by tracing the route a packet takes. This command can show each host the packets routes through while reaching a specific host. Using this information, you can track the cause of the problem where the packet is getting lost.
It also tells the time it takes to reach each host, so you can also track network performance issues. How to use tracert command and its parameters
DriverQuery
The command driverquery shows the complete list of installed drivers in your PC along with the history of when they were installed. Although the Windows Device Manager is a better tool to fix driver issues, this command can help when you need to track driver installation history.
How to use driverquery command and its parameters
SystemInfo
With systeminfo command you can view detailed information about your PC and the OS, such as system owner, PC model, boot time, network name, system type, and much more. It also shows basic information about hardware, including processor, RAM, and disk space.
How to use systeminfo command and its parameters
Powercfg
powercfg command is used to manage the power options of Windows. Unlike the regular power options settings of Windows, powercfg lets you run commands that are impossible to do from power settings, like import/export settings or track wake times. How to use powercfg command and its parameters
SFC/scannow
SFC (System File Checker) is the command used to check all the system files and look for errors. Once found, the command will automatically replace the file with a new one from the cache. Although it has multiple parameters, the most common one is sfc/scannow that simply runs the scan on all the system files.
How to use the SFC command and its parameters
Chkdsk
This command is used to scan the hard drive for logical or physical errors and automatically fix them. However, you need to use the right parameter to fix the errors. For most users, the command chkdsk/r should be enough to find and fix file system errors and bad sectors automatically.
How to use chkdsk command and its parameters
Netstat
A powerful network troubleshooting command that shows both incoming and outgoing connections to your PC along with the protocol type. Not only that, but you can also use netstat command to do a bunch of other things using parameters. You can see the routing table, the number of bytes and packets sent/received, process ID (PID), program name that established the connection, and many more.
Tasklist
A simple command to see the currently running processes on a PC, similar to the processes tab in the task manager of Windows. However, tasklist command is more useful for seeing processes of another PC remotely. Although keep in mind that it doesn’t show memory usage in real-time, unlike the task manager. How to use tasklist command and its parameters
GetMac
If you need to see the MAC address of a PC or multiple PCs connected over a network, then getmac is the right command. Using without parameters, it will show the MAC address of the current device. Although you can use parameters to view MAC addresses of PCs over a network.
How to use getmac command and its parameters
Shutdown/s
The shutdown command has many parameters to control the shutdown and restart of a PC or multiple PCs remotely. The command shutdown/s will shut down the current PC after a delay. You can also use parameters like /r or /h to restart the specified PC or put it in hibernate state. Definitely, a must-know command to quickly shutdown multiple PCs you are managing.
Assoc
You can use this command to view and manage file associations of a PC. The assoc command will list all the file extensions along with programs associated with them. You can add the extension next to the assoc command to see the program associated with that extension; for example, assoc .mp3 will show the program that runs mp3 files on the PC.
You can also use parameters to change file associations on the PCs remotely. How to use assoc command and its parameters
Robocopy
It’s similar to the copy/paste feature of Windows, but it’s extremely customizable using parameters. The basic robocopy
This command has dozens of parameters that can give full control over moving data, perfect for managing data between multiple PCs. How to use robocopy command and its parameters
Format
If you need to format the disk without access to the formatting feature of Windows, then format is a powerful command to do it. You need to provide the volume label, and the command will delete all the data on that volume. You can also configure file system type, change volume label, change allocation unit size, create compressed volume, and much more using parameters. How to use format command and its parameters
Hostname
You need to know the hostname of a computer to create a remote connection, and hostname command can easily tell you the name of any PC. Just type hostname, and the command prompt will immediately tell you the hostname of the PC. It’s a simple command that doesn’t even have parameters, but it’s extremely useful when you need to create remote connections.
Ending thoughts
These were command prompt commands that I believe will immensely help with a system administrator’s day-to-day tasks. If you are interested in learning more commands, you can check the Windows commands list by Microsoft. You can click on any of the commands to learn what it does and see its parameters.