windows 7 - Can't run command prompt "Run as Admin"

25
2014-04
  • Black

    I'm not able to open an elevated command prompt in Windows 7 Ultimate. Previously I was able to open such a command prompt in one of the following ways:

    • Start > type "cmd" then hit Ctrl + Shift + Enter
    • Start > type "cmd" then right click "cmd" and select Run as Administrator.

    However when I try this now I only get a normal command prompt without administrator rights.

    Any ideas what could be wrong, and how I could fix it?

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    windows 7 - When I start command prompt w/ administrative rights, the "Start in" location is igored. Any way to avoid this?
  • Giscard Biamby

    Possible Duplicate:
    Windows 7 Administrator Command Prompt “Start in” Path

    I have it set to c:\myfolder. If i click Start->Command Prompt it opens a console window started at c:\myfolder.

    If i use Ctrl+Shift+click (start a program w/ administrative rights) to start Command Prompt, it opens to c:\windows\system32.

    Why? And how to fix this?


  • Related Answers
  • Seasoned Advice (cooking)

    only if you change the default startup directory for the command prompt globabally, so it will always start in this directory:

    • Click Start, Run and type Regedit.exe
    • Navigate to the following branch:

    HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor

    • In the right-pane, double-click Autorun and set the startup folder path as its data, preceded by "CD /d ". If Autorun value is missing, you need to create one, of type REG_EXPAND_SZ or REG_SZ in the above location.

    alternatively you may add this option to your contect menu:

    Launch an elevated Command Prompt from the context menu

    To add the Open Command Window Here (Administrator) option to the context menu for file system folders, use the following REG file:

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="Open Command Window Here (Administrator)"
    
    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /s /k pushd \"%V\""
    

    To add the entry to Computer (My Computer) context menu, use the following REG file:

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\runas]
    @="Open Command Prompt (Administrator)"
    
    [HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\runas\command]
    @="cmd.exe"
    

    Usage

    Copy the above contents to Notepad, and save the file with .REG extension. Then right-click the REG file and choose Merge.

    Source