Open command window here as administrator - Add in Windows 10  

Page 1 of 13 12311 ... LastLast
    Open command window here as administrator - Add in Windows 10

    Open command window here as administrator - Add in Windows 10

    How to Add 'Open command window here as administrator' context menu in Windows 10
    Published by Category: Customization
    26 Jan 2021
    Designer Media Ltd

    How to Add "Open command window here as administrator" context menu in Windows 10


    A command prompt is an entry point for typing computer commands in the Command Prompt window. By typing commands at the command prompt, you can perform tasks on your computer without using the Windows graphical interface.

    This tutorial will show you how to add or remove a Open command window here as administrator context menu for all users in Windows 10.

    This context menu will open an elevated command prompt using the same working directory that you right clicked on.

    You must be signed in as an administrator to add, remove, and use the "Open command window here as administrator" context menu.


    The "Open command window here as administrator" context menu will be available when you right click or shift + right click on a folder, drive, or mapped network drive and when you right click or shift + right click on the background of a folder, drive, mapped network drive, library background, or desktop.


    EXAMPLE: "Open command window here as administrator" context menu
    Open command window here as administrator - Add in Windows 10-open_cmd_here_as_admin_context_menu.jpg



    Here's How:

    1 Do step 2 (add-right click), step 3 (add-Shift+right click) , or step 4 (remove) below for what you would like to do.


    2 To Add Right Click "Open command window here as administrator" Context Menu

    A) Click/tap on the Download button below to download the file below, and go to step 5 below.

    Add_Open_command_window_here_as_administrator.reg

    Download


    3 To Add Shift + Right Click "Open command window here as administrator" Context Menu

    A) Click/tap on the Download button below to download the file below, and go to step 5 below.

    Add_Shift+Open_command_window_here_as_administrator.reg

    Download


    4 To Remove "Open command window here as administrator" Context Menu

    This is the default setting.

    A) Click/tap on the Download button below to download the file below, and go to step 5 below.

    Remove_Open_command_window_here_as_Administrator.reg

    Download


    5 Save the .reg file to your desktop.

    6 Double click/tap on the downloaded .reg file to merge it.

    7 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

    8 Restart the computer to apply.

    9 You can now delete the downloaded .reg file if you like.


    That's it,
    Shawn






  1. Posts : 2
    win 10 insiders slow ring
       #1

    %V isn't recognized. you want %L. using your .reg files i get context menu items that open c:\windows\system32 and an error message that complains that the path isn't found, presumibly pushd's confusion when whatever %V is shows up where a path is expected. also why powershell instead of just invoking cmd in a runas context? (that last bit is curiousity, not telling you how to do things )
      My Computer


  2. Posts : 68,543
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    Hello Tom, and welcome to Ten Forums. :)

    "%V" should be recognized since it's what was originally used by default in Windows. It's working fine on my system using "%V". What directory was giving you this issue?

    • %L – Long file name form of the first parameter. Note that Win32/64 applications will be passed the long file name. Could be a location to a file.
    • %V – For verbs that are none implies all. If there is no parameter passed this is the working directory. Could be the directory name.


    I didn't use the "runas" key for the context menu since it would tie up the key for only this context menu. The PowerShell command is one workaround for elevation without using the "runas" key.

    Do you get a UAC prompt when you use the context menu?
      My Computers


  3. Posts : 2
    win 10 insiders slow ring
       #3

    Brink said:
    Hello Tom, and welcome to Ten Forums. :)

    "%V" should be recognized since it's what was originally used by default in Windows. It's working fine on my system using "%V". What directory was giving you this issue?

    • %L – Long file name form of the first parameter. Note that Win32/64 applications will be passed the long file name. Could be a location to a file.
    • %V – For verbs that are none implies all. If there is no parameter passed this is the working directory. Could be the directory name.


    I didn't use the "runas" key for the context menu since it would tie up the key for only this context menu. The PowerShell command is one workaround for elevation without using the "runas" key.

    Do you get a UAC prompt when you use the context menu?
    i don't get a UAC prompt, but that is by design (i've toggled UAC all the way down.)

    strange that it didn't work for me, while i was examining the other shell reg entries, i noticed the that the default "hide unless shift used" entries were using %V, so i made a few runas entries using %V as well and they worked as expected.

    i suspect, then, that maybe my download got mangled (weird), or maybe i have execution-policy or somesuch PS related config amiss (weirder). i'm keen to try it again, will let you know what happens.

    thanks for the welcome btw. 20+ win/all admin and system engineer. MCSE 2003, working on 2012 and then 2016 MCSA, maybe MCSE. Feel at home already. I'm glad my curiousity wasn't taken as a flame (it does happen sometimes, we like to be right, us humans lol). hopefully i'll be a productive member here. :)
      My Computer


  4. Posts : 68,543
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #4

    I look forward to hearing your findings.

    Nar, I'll never take it as flaming. We're always learning.
      My Computers


  5. Posts : 87
    Windows 10 X64 Home
       #5

    mmmmmmm.. i have a path there's no working............ the path it's:
    D:\Indiana Jones - Tomba Imperatore - GOG\Indiana Jones and the Emperor's Tomb\GameData\indy\movies

    If i choose this "movies" folder and use "Open Windows Prompt from here" from context menu nothings append..... all it's working only if i use the very fist folder but if i try to open the second sub-folder i obtain same result....... because that append ?
      My Computer


  6. Posts : 68,543
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #6

    Hello DJ, :)

    See if merging the .reg file again to add the context menu may help in case its registry entries may have been modified by something.

    If it doesn't help, then please go ahead and post a screenshot showing the command prompt after your right click on the folder and click on "Open command window here as administrator" to see if it may reveal anything.
      My Computers


  7. Posts : 87
    Windows 10 X64 Home
       #7

    ^^
    I can't re-add the .reg posted above.... because i have make some change in my registry respect this .reg... on my registry i have this:
    Code:
    Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\00_CmdHereAsAdmin
    It's contain the exact value of "OpenCmdHereAsAdmin" for example......

    I have check all other value and all it's identical... i have translate the value to Italian for example :)

    I can't also post a screenshot because when i choose "Open commands prompt" nothings appends in this specific case......

    I can post this....... this is the case:


    If i choose "Apri promt dei comandi qui.." (in italian) i can see for a little moment the powershell and after nothings append.....

    It's also obtain same things when i choose the stepback folder............ instead the command prompt it's work only if i launch from d:\ when i select the folder "Indiana Jones - Tomba Imperatore - GOG". For every sub-folder inside this it's not works.......

    It's very strange because i have also similar tree subfolders in same D: hard disk and apparently only whit this Indiana Jones it's not works...

    *EDIT*
    I have an idea... it's possible it's not woks because the subfolders contain the char " ' " inside the names ???

    *EDIT 2*
    I HAVE FOUND THE PROBLEMS!!!

    I have created a folder called "ciao mamma's" on my D:\.

    I have tryed to use "Apri prompt dei comandi qui..." and.......... it's not works............

    i see the command's it's:
    Code:
    PowerShell -windowstyle hidden -Command "Start-Process cmd -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"
    it's the %V the path right ?? I thinks it's can help if i put the %V inside two " " like "%V" ?
      My Computer


  8. Posts : 68,543
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #8

    Hello DJ, :)

    I just tested, and it's the apostrophe in the folder's name causing it to not work. If you rename the folder to remove the apostrophe, it should work.

    Wrapping quotes around %V makes no difference.
      My Computers


  9. Posts : 87
    Windows 10 X64 Home
       #9

    Brink said:
    Hello DJ, :)

    I just tested, and it's the apostrophe in the folder's name causing it to not work. If you rename the folder to remove the apostrophe, it should work.

    Wrapping quotes around %V makes no difference.
    yeah... but i can't modify the folder name of games of indiana jones or the games it's no working after it because some value it's stored on registry.

    At this point it's a limitation of this feature ? :)
      My Computer


 

Tutorial Categories

Open command window here as administrator - Add in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:00.
Find Us




Windows 10 Forums