Not enough permission to run typeperf.exe

心已入冬 提交于 2019-12-11 01:53:58

问题


Im Trying to run typeperf.exe with an php function exec();

this is the command ( for cpu load % ) typeperf -sc 1 "processor(_Total)\% Processor Time"

When im runing the command through a command prompt it is returning me the wanted result.

But when calling it trough exec(); Im getting

So I ran the command whoami through php to know what is the php user,

I got nt authority\iusr

So I setted the username to be in the Performance Log User Group as mentioned. And deseperatly added everyone in the group since this was not working.

What can I do to let php run a typeperf.exe comand ?


回答1:


You mention it does work when using command prompt. But even when using command prompt you need to start it as administrator (windows 8, possibly 7). If you dont you get the same error message.

So perhaps you could try to disable user account control to allow access without specific administrator privileges.. Check how-do-i-disable-administrator-prompt-in-windows-8 for some tips.

Also it mentions that the rights are only updated after logging in with the account. So it could very well be that your changes never do anything as you never log in using 'Everyone' or 'IUSR'.



来源:https://stackoverflow.com/questions/23379302/not-enough-permission-to-run-typeperf-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!