Basic windows commands (ping, ipconfig) need admin rights - looking for an option

怎甘沉沦 提交于 2019-12-07 18:06:57

问题


On my main pc (Win 7 64bit) basic windows commands like ping and ipconfig suddenly need admin rights.

If I start a normal command-line window, these commands are not found anymore ("X is not recognized as an internal or external command, operable program or batch file.")

If I start the command-line window with "Run as Administrator" everything works as expected.

On my second PC (Win 7 32 bit) I do not need admin rights. And I strongly believe that I did not need admin rights on my main pc a couple of weeks ago. Something must have changed, thus I think there must be some (registry) switch or something.

any ideas? thanks a lot

[edit]

I am still the admin user - just starting cmd normally, not with "run as admin"

[edit2]

It indeed was the PATH, variable. Problem was, that Path was saved as the wrong type of string in the registry

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path

has to be a REG_EXPAND_SZ as explained in this thread. Path being of the wrong type of string made it unable to expand %SystemRoot%. Make sure that both your system PATH as well as your user PATH environment variables are of type REG_EXPAND_SZ.


回答1:


Srart normal cmd prompt and look at output of the following commands

set path
dir %windir%\system32\ping.exe
dir %windir%\syswow64\ping.exe
dir %windir%\sysnative\ping.exe

Thought, they will show you a problem. May be ping is not found by %path% or somehow...




回答2:


In an effort to narrow down the issue try the following:

  • open command prompt
  • make sure you are on the C:\ directory
  • type this: windows\system32\ipconfig /all

That will point to the default location for the command... You can also follow the path out to see if the ipconfig.exe is there in the first place. If that doesn't work or the file is not there, it could be corrupt or you could possibly have a virus designed to disable these commands.



来源:https://stackoverflow.com/questions/12412000/basic-windows-commands-ping-ipconfig-need-admin-rights-looking-for-an-optio

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