Skip to content

Diagnostics.PerformanceCounter Input string was not in a correct format

when you try to get performance information you receive the following error at the initialiser

Dim Ram As New Diagnostics.PerformanceCounter(“Memory”, “Available MBytes”)

Input string was not in a correct format

Starting “perfmon” from your run box to open the performance monitor presents you with a message box

Performance Monitor Control
Unable to add these counters:

\Memory\Available MBytes
\Memory\% Committed Bytes In Use
\Memory\Cache Faults/sec
\Memory\Cache Faults/sec
\PhysicalDisk(*)\% Idle Time
\PhysicalDisk(*)\Avg. Disk Queue Length
\Network Interface(*)\Bytes Total/sec

Easy fix, you need to rebuild your performance counters. I copied c:\windows\system32\PerfStringBackup.ini from a machine whos counters were working, replaced the one on the broken machine. Open a command prompt, navigate to the same location and run the following

lodctr /R:PerfStringBackup.INI

This will reload your counters

If that fails try what microsoft suggest Here

Posted in Configuration, Development, Infrastructure.

One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Adrian says

    Thanks. It works for me.

Some HTML is OK

or, reply to this post via trackback.