Stop CMD from always opening with administrator privileges

No matter how I open it, cmd.exe always opens with admin privileges. How can I open it without? Is there some registry setting missing? Even if I open it directly from the run dialog or by double clicking in the system32 folder it still opens with admin privs.

Thanks.


Found out I was missing a registry key. In HKEY_CLASSES_ROOTDirectoryshellcmd I was missing the String Value "Extended". Added this back in and restarted the machine got rid of the defaulting to admin privileges.

EDIT : I had UAC turned off for my profile (to stop incessant "are you sure you want to open this .exe" warnings), and turning that back on has stopped cmd always running with greater privileges.


After some unclear actions (switch UAC on/off ?) I ended up in the same situation as described above:

  • Cmd.exe always starts in Adminstration mode.

  • Linking in VS failed with the message: Project : error PRJ0003 : Error spawning 'C:windowssystem32cmd.exe'.

  • The Properties | Compatibility tab is greyed out, so switching this off seems impossible (Compatibility modes cannot be set on this program because it is part of this version of Windows).

    To recover from this situation you have to edit the registry to remove the RUNASADMIN preferences that is associated with cmd.exe.

    The 'RUNASADMIN' preference is stored in these registry keys:

    HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers

    Delete the values named c:windowssystem32cmd.exe and you are back in business !

    Kees


    Right click on the cmd.exe, select properties and check the compatibility tab. Is the Run this program as an administrator checkbox checked?

    链接地址: http://www.djcxy.com/p/56844.html

    上一篇: 在全屏中使用WebView和RelativeLayout时出现奇怪的行为

    下一篇: 停止CMD始终以管理员权限打开