15 Windows command line commands that a system administrator needs to know

Windows Command Prompt can perform many unique tasks that cannot normally be performed by other Windows components. Best of all, it works even when other Windows components break down, making it the best tool for system administrators to master.

As a system administrator, Windows Command Prompt can help you get more information about computers and run automated commands on multiple computers at the same time to perform tasks remotely. Whether you want to get complete information about connected networks, fix file errors, get information about hardware components, or manage volumes, you can do it all through the command line.

If you are new to using the command line as a system administrator, I can help you get started. Although there are hundreds of commands, in this post I will list some of the more useful ones that are commonly used by system administrators.

How to access the command line in Windows?

First you need to know how to access the command prompt and run commands from it. The easiest way to do this is with the Run command.

Press the Windows + R keys to open the Run dialog box and type cmd in it to launch Command Prompt. You can then type in the commands I have mentioned below and hit the Enter key to execute them.

For some commands that interfere with system files and components, you may need to run Command Prompt as an administrator. To do this, simply search for cmd in the Windows search box, right-click on the command line application, and select "Run as administrator".

Now that you know how to access the command prompt and use commands, let's take a look at 15 Windows Command Prompt commands that will help you as a system administrator.

ipconfig/all

Whether you need to fix connection errors or create a remote connection to other PCs, the ipconfig /all command is your best friend. This command will show all network configuration values ​​in one place. This includes the hostname, IP address, default gateway, subnet mask, network features, and more.

How to use the ipconfig /all command and its options

tracing

If the computers you manage are part of a large network and are connected through multiple routers or bridges, the tracert command can help you find network problems by tracing the path a packet takes. This command can show each host that packets pass through when reaching a specific host. Using this information, you can track down the cause of the problem causing the packet to be lost.

It also reports the time it takes to reach each host, so you can track network performance issues as well.

How to use the tracert command and its options

DriverQuery

The driverquery command shows a complete list of installed drivers on your PC along with their installation history. Although Windows Device Manager is the best tool for fixing driver problems, this command can help when you need to keep track of your driver installation history.

How to use the driverquery command and its options

System Information

With the systeminfo command, you can view detailed information about your PC and OS, such as system owner, PC model, boot time, network name, system type, and more. It also shows basic hardware information, including CPU, RAM, and disk space.

How to use the systeminfo command and its options

Powercfg

The powercfg command is used to manage Windows power settings. Unlike normal Windows power options, powercfg allows you to run commands that cannot be run from power options, such as import/export options or wake time monitoring.

How to use the powercfg command and its options

sfc/scan

SFC (System File Checker) is a command used to check all 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 several options, the most common one is sfc /scannow which simply runs a scan of all 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 fix them automatically. However, you need to use the correct parameter in order to fix the errors. For most users, chkdsk /r should be enough to automatically find and fix file system errors and bad sectors.

How to use the chkdsk command and its options

Netstat

A powerful network troubleshooting command that shows both incoming and outgoing connections to your PC, as well as the protocol type. Not only that, but you can also use the netstat command to perform many other actions using parameters. You can see the routing table, the number of bytes and packets sent/received, the process ID (PID), the name of the program making the connection, and more.

The list is given

A simple command to view the currently running processes on a PC, similar to the processes tab in Windows Task Manager. However, the tasklist command is more useful for monitoring the processes of another PC remotely. Although be aware that it does not show real-time memory usage, unlike Task Manager.

How to use the task list command and its options

GetMac

If you need to see the MAC address of a PC or multiple PCs connected over a network, then the getmac command is what you need. When used without parameters, it will show the MAC address of the current device. Although you can use the options to view the PC's MAC addresses over the network.

How to use the getmac command and its options

Shutdown/s

The shutdown command has many options to remotely control the shutdown and restart of a PC or multiple PCs. The shutdown /s command will shut down the current PC after a delay. You can also use options such as /r or /h to restart or hibernate the specified computer.

Definitely a must-have command for quickly shutting down multiple computers that you manage.

assistant

You can use this command to view and manage PC file associations. The assoc command will list all file extensions along with their associated programs. You can add an extension next to the assoc command to see the program associated with that extension; for example, assoc .mp3 will show a program that runs mp3 files on a PC.

You can also use the options to change file associations on a PC remotely.

How to use the assoc command and its options

Robocopy

It's similar to the Windows copy/paste feature, but it's extremely easy to customize with options. Basic robocopy command will copy/paste the file to the specified destination. You can add options such as /nocopy to remove related information, or /s to exclude empty subdirectories.

This command has dozens of options that can give you complete control over data movement, ideal for managing data between multiple PCs.

How to use the robocopy command and its options

Format

If you need to format a drive without accessing the Windows format feature, then format is a powerful command to do so. You need to specify a volume label and the command will delete all data on that volume. You can also configure the file system type, change the volume label, change the allocation unit size, create a compressed volume, and more using options.

How to use the format command and its options

Hostname

You need to know the hostname of a computer in order to create a remote connection, and the hostname command can easily tell you the name of any PC. Just type in the hostname and the command line will immediately tell you the hostname of the PC. It's a simple command that doesn't even take parameters, but it's extremely useful when you need to create remote connections.

Final Thoughts

These were command line commands that I believe will be of great help to a system administrator in day to day tasks. If you want to learn more about commands, you can view the list of Windows commands. from Microsoft . You can click on any of the commands to find out what it does and see its options.

Related posts