【问题标题】:How to give users the right to use typeperf.exe如何赋予用户使用 typeperf.exe 的权利
【发布时间】:2014-05-05 02:56:23
【问题描述】:

我正在尝试运行以下命令typeperf -sc 1 "processor(_Total)\% Processor Time"

以百分比获取 cpu 负载

由于我是管理员,所以当我通过我的用户名运行该命令时它运行良好。

我创建了另一个名为test的用户

使用测试登录并尝试使用test 用户运行命令并获取

Exiting, please wait...                         
Error: No valid counters.

我在 Performance Log Users 组中正确添加了 test 用户,因为 typeperf.exe 应用程序应该只让这些用户使用它

还请注意,这个问题在某种程度上与我几天前提出的Not enough permission to run typeperf.exe 问题有关。

我想知道我还能做些什么来让其他用户使用 typeperf.exe

如果此信息相关,我使用的是 Windows 8 Pro

提前感谢您的帮助。

-编辑----------------

如评论中所述

当我在 test 用户上运行以下命令 typeperf -q Processor 时,我得到以下响应

\Processor(*)\% Processor Time
\Processor(*)\% User Time
\Processor(*)\% Privileged Time
\Processor(*)\Interrupts/sec
\Processor(*)\% DPC Time
\Processor(*)\% Interrupt Time
\Processor(*)\DPCs Queued/sec
\Processor(*)\DPC Rate
\Processor(*)\% Idle Time
\Processor(*)\% C1 Time
\Processor(*)\% C2 Time
\Processor(*)\% C3 Time
\Processor(*)\C1 Transitions/sec
\Processor(*)\C2 Transitions/sec
\Processor(*)\C3 Transitions/sec
Exiting, please wait...                         
The command completed successfully.

【问题讨论】:

  • 无需管理员身份或加入Performance Log Users 组即可正常工作(Windows 7 SP1)。 typeperf -q Processor 说什么?
  • 感谢您的输入,我在我的 OP 中添加了命令的响应

标签: windows permissions permission-denied


【解决方案1】:

你只需要转义 % 符号,例如:typeperf "\Process(Idle)\%% Processor Time"

【讨论】:

  • 是的,如果它是从批处理文件中调用的。毕竟这与用户权利无关。
  • OP 没有提到使用批处理文件 - 但这是一个完全合理的猜测,而且我没有想到。 +1。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-07-26
  • 1970-01-01
  • 2016-09-15
  • 2011-12-22
  • 2018-03-24
  • 2017-06-11
  • 1970-01-01
相关资源
最近更新 更多