Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 873
edwardmlyte Avatar asked Dec 19 '11 11:12

edwardmlyte


2 Answers

Found out I was missing a registry key. In HKEY_CLASSES_ROOT\Directory\shell\cmd 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.

like image 57
edwardmlyte Avatar answered Oct 02 '22 20:10

edwardmlyte


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:\windows\system32\cmd.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_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

Delete the values named c:\windows\system32\cmd.exe and you are back in business !

Kees

like image 20
Kees Avatar answered Oct 02 '22 21:10

Kees