Windows 10: Open command window here as administrator - Add in Windows 10  

    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
    14 Dec 2016
    Designer Media Ltd

    Published by


    Brink's Avatar
    Administrator

    Posts: 20,696

    Show Printable Version 


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

    information   Information
    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.

    Note   Note
    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 or drive, and when you right click or shift + right click on the background of a folder, drive, library, or desktop.


    EXAMPLE: "Open command window here as administrator" context menu
    Click image for larger version. 

Name:	Open_CMD_here_as_admin_context_menu.jpg 
Views:	1144 
Size:	122.0 KB 
ID:	95366



    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

    NOTE: 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. If prompted, click on Run, Yes (UAC), Yes, and OK to approve the merge.

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




    That's it,
    Shawn



  1. Posts : 2
    win 10 insiders slow ring
       1 Week Ago #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 ComputerSystem Spec


  2. Posts : 20,696
    64-bit Windows 10 Pro build 16199
    Thread Starter
       1 Week Ago #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 ComputersSystem Spec


  3. Posts : 2
    win 10 insiders slow ring
       1 Week Ago #3

    Brink said: View Post
    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 ComputerSystem Spec


  4. Posts : 20,696
    64-bit Windows 10 Pro build 16199
    Thread Starter
       1 Week Ago #4

    I look forward to hearing your findings.

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


 

Related Threads
When selecting the command prompt from the right click on startup options I get the following message: 'This file does not have a program associated with it for performing this action. Please install a program, or if one is already...
General Tips Open Command Prompt in Windows 10 in Tutorials
How to Open a Command Prompt 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...
How to Open an Elevated Command Prompt in Windows 10 A command prompt is an entry point for typing computer commands in the Command Prompt window. By typing commands in an elevated command prompt, you can perform tasks that require...
How to Open a Command Prompt at Boot 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...
I tried the runas command to configure some software I just updated, as the directions said, but my administrator password was rejected. Then I tested the runas command on a pdf file that I know for sure is in the current directory (it can open from...
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 04:03.
Find Us