Power Tip: Elevated Command Prompt Here in Windows 8.1
Join the DZone community and get the full member experience.Join For Free
from my last post on “ power tip for windows users: open command prompt here ”, i was asked what about an elevated command prompt inside a folder? this is a very good question and rahul responded that you can use (alt-f-m-a ) as shown below:
while i am not opposed to doing that, i actually think life would be easier if we just added it to the context menu. while we are here, we can also add the required keys to open an elevated prompt of every drive letter attached to the system. this can easily be accomplished by adding an entry in the registry. so copy/paste the text below into a text file and give it a name of something like “ admin.reg ” and double-click it.
windows registry editor version 5.00 [-hkey_classes_root\directory\shell\runas] [hkey_classes_root\directory\shell\runas] @="open command window here as administrator" "hasluashield"="" [hkey_classes_root\directory\shell\runas\command] @="cmd.exe /s /k pushd \"%v\"" [-hkey_classes_root\directory\background\shell\runas] [hkey_classes_root\directory\background\shell\runas] @="open command window here as administrator" "hasluashield"="" [hkey_classes_root\directory\background\shell\runas\command] @="cmd.exe /s /k pushd \"%v\"" [-hkey_classes_root\drive\shell\runas] [hkey_classes_root\drive\shell\runas] @="open command window here as administrator" "hasluashield"="" [hkey_classes_root\drive\shell\runas\command] @="cmd.exe /s /k pushd \"%v\""
now if you shift-right click on any folder, you will see both options:
you can also just right click on any folder and see the “ open command windows here as administrator ” prompt. according to your uac settings, you may have to allow windows to run in this elevated mode. this works for drive letters as well.
if you don’t care what path you start in, pressing “windows x then a” is your best bet.
i hope this helps. take care and i’ll return you to your regularly scheduled program – michael on mobile!
Published at DZone with permission of Michael Crump. See the original article here.
Opinions expressed by DZone contributors are their own.