TLDR; This blog covers Windows commands for system and process monitoring, including systeminfo
, tasklist
, taskmanager
, perfmon
, typeperf
, dir
, chkdsk
, ipconfig
, netstat
, taskkill
, taskcreate
, start
, and wmic
. These commands provide an efficient way to access system and process info and take action to resolve any issues. Caution and best practices should be exercised when using these commands.
Introduction to Windows commands for system and process monitoring
The Windows Command Prompt is a CLI that enables users to execute commands, manage system/processes and monitor system/resources/performance/disk/network. Accessed by clicking Start, typing “cmd” in the search bar and clicking the Command Prompt app, it is an essential tool for power users and admins. Benefits of using Windows commands for monitoring include speed, efficiency, ease of use and ability to automate tasks.
Common Windows commands for system monitoring
In this section, we will explore the most commonly used Windows commands for system monitoring.
System Information
To get information about your system, you can use the following commands:
systeminfo
The systeminfo
command provides detailed information about your system, including the operating system, computer name, and system uptime.
C:\>systeminfo
Host Name: DESKTOP-ABC
OS Name: Microsoft Windows 10 Enterprise
OS Version: 10.0.19042 N/A Build 19042
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
...
winver
The winver
command displays the current version of Windows installed on your system.
C:\>winver
Resource Usage
To monitor the resource usage of your system, you can use the following commands:
tasklist
The tasklist
command displays a list of all running processes and their associated process IDs (PIDs).
C:\>tasklist
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
System Idle Process 0 Console 1 24 K
System 4 Console 1 1,676 K
smss.exe 404 Console 1 1,736 K
csrss.exe 552 Console 1 208,020 K
wininit.exe 624 Console 1 12,224 K
...
taskmanager
The taskmanager
command opens the Task Manager, which provides a graphical representation of the resource usage of your system, including CPU usage, memory usage, and disk usage.
C:\>taskmanager
Performance Monitoring
To monitor the performance of your system, you can use the following commands:
perfmon
The perfmon
command opens the Performance Monitor, which provides a graphical representation of various performance metrics, including CPU usage, memory usage, disk usage, and network usage.
C:\>perfmon
typeperf
The typeperf
command allows you to view performance data in the command prompt. You can specify the performance counters you want to view, such as CPU usage or memory usage.
C:\>typeperf "\\Processor(_Total)\\% Processor Time"
Disk Usage
To monitor the disk usage of your system, you can use the following commands:
dir
The dir
command displays a list of all files and directories in a specified path. You can use the /s
option to include the size of each file and directory.
C:\>dir /s
Volume in drive C has no label.
Volume Serial Number is ABCD-EFGH
Directory of C:\\
12/02/2023 11:00 AM <DIR> .
12/02/2023 11:00 AM <DIR> ..
11/02/2023 11:00 AM <DIR> Program Files
11/02/2023 11:00 AM <DIR> Windows
0 File(s) 0 bytes
4 Dir(s) 123,456,789,012 bytes free
chkdsk
The chkdsk
command is used to check the integrity of your disk and fix any errors. You can use the /f
option to automatically fix any errors.
C:\>chkdsk /f
The type of the file system is NTFS.
Volume label is Windows.
...
100 percent completed
Windows has made corrections to the file system.
...
Network Monitoring
To monitor your network, you can use the following commands:
ipconfig
The ipconfig
command displays information about the network configuration of your system, including the IP address, subnet mask, and default gateway.
C:\>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : example.com
Link-local IPv6 Address . . . . . : fe80::abc:def:ghi:jkl%12
IPv4 Address. . . . . . . . . . . : 192.168.0.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.254
...
netstat
The netstat
command displays information about the network connections of your system, including the local and remote addresses, status, and protocol.
C:\>netstat
Active Connections
Proto Local Address Foreign Address State
TCP 192.168.0.1:1234 example.com:80 ESTABLISHED
TCP 192.168.0.1:5678 stackoverflow.com:443 TIME_WAIT
UDP [::]:123 :
...
Common Windows commands for process monitoring
In this section, we will explore the most commonly used Windows commands for process monitoring.
Process Information
To get information about the processes running on your system, you can use the following commands:
tasklist
The tasklist
command displays a list of all running processes and their associated process IDs (PIDs).
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
System Idle Process 0 Services 0 8 K
System 4 Services 0 21.256 K
Secure System 172 Services 0 80.796 K
Registry 212 Services 0 38.932 K
smss.exe 720 Services 0 1.040 K
csrss.exe 1172 Services 0 4.132 K
wininit.exe 1264 Services 0 4.912 K
taskmanager
The taskmanager
command opens the Task Manager, which provides a graphical representation of the processes running on your system, including the process name, PID, status, and memory usage.
C:\>taskmanager
Process Management
To manage processes on your system, you can use the following commands:
taskkill
The taskkill
command allows you to terminate a process by specifying its PID or process name.
C:\>taskkill /pid 1234
SUCCESS: The process with PID 1234 has been terminated.
Process Priority
To change the priority of a process, you can use the following commands:
start
The start
command allows you to start a new process.
C:\>start notepad.exe
Key takeaways from this blog
- The Windows Command Prompt is a powerful tool for managing and monitoring your system and processes.
- Common Windows commands for system monitoring include
systeminfo
,tasklist
,taskmanager
,perfmon
,typeperf
,dir
,chkdsk
,ipconfig
, andnetstat
. - Common Windows commands for process monitoring include
tasklist
,taskmanager
,taskkill
,start
, andwmic
.
By using these commands, you can gain a deeper understanding of your system and processes, and take steps to optimize performance and resolve any issues.