0

It's been a while I can't start CMD as Admin by:

  • right click on start (windows logo)
  • Windows PowerShell (Admin)

or

  • left click on start (windows logo)
  • typing "CMD"
  • right click on Command Prompt and selecting Run as administrator

or

  • CMD icon is on desktop
  • right click on it and selecting Run as administrator

Only way to do it is to go to C:\WINDOWS\system32 and there right click and select Run as administrator

How can I restore Run as administrator for CMD/PowerShell ?

3 Answers 3

0

I remember that I have seen a similar problem before.

They can't open the CMD/Powershell as Administrator, too.

The cause is that the antivirus software put a file consent.exe in its virus chest. So the system cannot scan the consent.exe. And trust consent.exe, make the CMD/Powershell as administrator work fine again.

So, check the antivirus software on your PC, and see if the consent.exe has been blocked.

Hope this can help you.

1
  • Unfortunately that is not my case. consent.exe is not in antivirus vault. Sep 5, 2018 at 17:03
0

I found answer here. It is not exactly what I wanted (default behaviour when right click on Command Prompt and selecting Run as administrator) but I created my own shortcut and named it as "Command Prompt Admin" and copied it into: C:\Users{my username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs

0

This is happening again in Windows 10 and the above answers are also not working.

The problem appears to be specific to 2019 era Windows 10 builds like build 1909 and 1903.

The symptoms are:

  1. It hangs while opening the window. The window is blank.

  2. A non-admin shortcut works fine.

  3. If the admin properties are set on the shortcut, the property is ignored when the shortcut launches (you no longer get an admin powershell).

  4. If you right click on the powershell taskbar icon and click "Run As Administrator" you get a message asking if you want to remove this shortcut because the program it points to is not found, or you get the powershell window opening and hanging.

  5. If you open visual studio debugger and attach to the hung powershell process, you can see it's hung inside a windows shell core dll.

     Not Flagged >   10608   0   Main Thread    Main Thread   
    SHCore.dll!00007ff839b47538
     Not Flagged     15512   0   Worker Thread   ntdll.dll thread    ntdll.dll!00007ff83ae3fa04
     Not Flagged     17232   0   Worker Thread   ntdll.dll thread    ntdll.dll!00007ff83ae3fa04
    

In this case, the solution I believe works is to update to a newer build of Windows 10 as I believe this bug is either (a) a bug in Windows 10 build 1903, or one of the patches issued since it released, or (b) simply a corrupt system file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .