Page 1 of 2 12 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
    23 Sep 2017
    Designer Media Ltd

    Published by


    Brink's Avatar
    Administrator

    Posts: 25,194

    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:	1501 
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


    Related Tutorials



  1.    12 May 2017 #1
    Join Date : May 2017
    Posts : 2
    win 10 insiders slow ring

    %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.    12 May 2017 #2
    Join Date : Oct 2013
    Posts : 25,194
    64-bit Windows 10 Pro build 17040
    Thread Starter

    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.    12 May 2017 #3
    Join Date : May 2017
    Posts : 2
    win 10 insiders slow ring

    Quote Originally Posted by Brink 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.    12 May 2017 #4
    Join Date : Oct 2013
    Posts : 25,194
    64-bit Windows 10 Pro build 17040
    Thread Starter

    I look forward to hearing your findings.

    Nar, I'll never take it as flaming. We're always learning.
      My ComputersSystem Spec
  5.    01 Aug 2017 #5
    Join Date : Sep 2016
    Posts : 55
    Windows 10 X64 Home

    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 ComputerSystem Spec
  6.    01 Aug 2017 #6
    Join Date : Oct 2013
    Posts : 25,194
    64-bit Windows 10 Pro build 17040
    Thread Starter

    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 ComputersSystem Spec
  7.    26 Aug 2017 #7
    Join Date : Sep 2016
    Posts : 55
    Windows 10 X64 Home

    ^^
    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 ComputerSystem Spec
  8.    26 Aug 2017 #8
    Join Date : Oct 2013
    Posts : 25,194
    64-bit Windows 10 Pro build 17040
    Thread Starter

    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 ComputersSystem Spec
  9.    31 Aug 2017 #9
    Join Date : Sep 2016
    Posts : 55
    Windows 10 X64 Home

    Quote Originally Posted by Brink View Post
    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 ComputerSystem Spec

 
Page 1 of 2 12 LastLast


Similar Threads
Tutorial Category
General Tips Open Command Prompt in Windows 10
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...
Tutorials
General Tips Open Elevated Command Prompt in Windows 10
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...
Tutorials
Solved Command Prompt not working for user or Administrator
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 Support
General Tips Open Command Prompt at Boot in Windows 10
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...
Tutorials
runas command won't recognize administrator password
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...
General Support
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 23:18.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums