📎 AI Summary:
The user encounters an "Error: No valid counters" when trying to use the `typeperf` command in a batch file to log CPU usage. The issue is resolved by running the command as an administrator, as indicated in subsequent replies. Despite elevated permissions, the problem persists, suggesting possible configuration or permission issues with performance counters.

CDWANG

Well-Known Member
Joined
Apr 25, 2016
Messages
5
Thread Author #1
Hi ,

Can anyone advise on this.

I was running a command as below using cmd batch file

typeperf "\Processor(_Total)\% Processor Time" >> Memory.txt

However, I could not display the output to the text file and it shows error :

Error: No valid counters.


Please kindly advice.

Regards
Wang
 

CDWANG

Well-Known Member
Joined
Apr 25, 2016
Messages
5
Thread Author #2
Hi all,

It shows this error when I open my notepad.


"
In order to use typeperf, you must either be a member of the local
Performance Log Users group, or the command must be executed from an
elevated command window."


Can someone advice me what to do , tks :)


Regards
CD
 

Neemobeer

Windows Forum Team
Staff member
Joined
Jul 4, 2015
Messages
8,995
Run the batch file as an administrator. Right click it and select "Run as Administrator"
 

Solution

CDWANG

Well-Known Member
Joined
Apr 25, 2016
Messages
5
Thread Author #4
Hi , Tks for your advice.

I have done that but still the program does not run well.
 

CDWANG

Well-Known Member
Joined
Apr 25, 2016
Messages
5
Thread Author #5
Hi The error message is as shown per attached file.
 

Attachments

  • Capture3.webp
    Capture3.webp
    16.7 KB · Views: 389