Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Monitoring disk performance is crucial for maintaining the health and efficiency of your Windows 11 system. One of the tools available for this purpose is diskperf.exe
. This command-line utility allows you to enable or disable disk performance counters, which are essential for gathering performance data.
Examples:
To start monitoring disk performance, you need to enable the disk performance counters. Follow these steps:
Open Command Prompt as Administrator:
Win + S
to open the search bar.cmd
.Command Prompt
and select Run as administrator
.Enable Disk Performance Counters:
Enter
:
diskperf -y
If you no longer need to monitor disk performance, you can disable the counters to save system resources:
Open Command Prompt as Administrator:
Disable Disk Performance Counters:
Enter
:
diskperf -n
To check the current status of disk performance counters, you can use the following command:
Open Command Prompt as Administrator:
Check Status:
Enter
:
diskperf
While diskperf.exe
is a useful tool, PowerShell offers more advanced capabilities for monitoring disk performance. Here’s how you can use PowerShell to gather disk performance data:
Open PowerShell as Administrator:
Win + X
and select Windows PowerShell (Admin)
.Get Disk Performance Data:
Enter
:
Get-Counter -Counter "\PhysicalDisk(*)\*" | Format-Table
You can create a script to automate the process of monitoring disk performance using PowerShell. Here’s a sample script:
Create a PowerShell Script:
Open Notepad and paste the following script:
$outputFile = "C:\disk_performance_log.txt"
$counters = "\PhysicalDisk(*)\*"
$interval = 5
$samples = 12
Get-Counter -Counter $counters -SampleInterval $interval -MaxSamples $samples |
Export-Csv -Path $outputFile -NoTypeInformation
.ps1
extension, for example, disk_performance_monitor.ps1
.Run the Script:
.\disk_performance_monitor.ps1
This script will collect disk performance data at 5-second intervals for a total of 12 samples and save the results to a CSV file.