Thomas' Tech Tips

Start Windows performance monitor data collector automatically at start up

8 September 2023 - Thomas Damgaard

Windows comes with a facility for gathering system performance metrics. This is a good utility to gather data that can be used to identify performane bottlenecks or general hardware resource utilization.

However, the interface for Windows Performance Data Collector Sets is lacking an extremely vital feature: there seems to be no way to configure a data collector set to start automatically at windows boot up. Even though there is a Schedule tab in the Properties dialog of the data collector set. This schedule seems to be a one-time schedule.

This makes is less usable on systems that are not always on. For example workstations or laptops.

Making Windows Performance Data Collector Sets start up automatically

In order to make a performance data collector set start up automatically, we first need a way to start the data collector programmatically.

This can be done by starting cmd as Administrator and running:

logman start Perfmetrics\DataCollector01

Example:

C:\WINDOWS\system32>logman start Perfmetrics\DataCollector01
The command completed successfully.

C:\WINDOWS\system32>logman

Data Collector Set                      Type                          Status
-------------------------------------------------------------------------------
perfmetrics                             Counter                       Running

The command completed successfully.

C:\WINDOWS\system32>

Save the command logman start Perfmetrics\DataCollector01 to a batch file, e.g. c:\scripts\start-perflog.bat.

Next, we need to ensure that the command is actually run on start up. There are several ways of doing that, but one way is to put an entry into Windows Registry.

To do this, open Redgistry Editor (regedit) and navigate to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Create a new String value with the following properties:

Name: Start-Perflogs
Type: REG_SZ
Data: c:\scripts\start-perflog.bat

Compatibility

I have tested this on Windows 10 Enterprise, but I would expect this to work on at least the following Windows versions:

Filed under: cmd, howto, perfmon, tips, windows

Back to article list