I want the option to open a Command window or Powershell window as Administrator from the drive and directory context menus in Windows.
I can have either by creating and populating the special 'runas' registry keys shown below, but is there a way I can have both listed on the context menu and have both run as Administrator?
[HKEY_CLASSES_ROOT\Drive\shell\runas]
...
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
...
[HKEY_CLASSES_ROOT\Directory\shell\runas]
...
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
...
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
...
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
...
Best Answer
Next registry hack works for directories on Windows 8.1:
You could add analogous
runas
andrunasPowerShell
subkeys for drives under the[HKEY_CLASSES_ROOT\Drive\shell]
as well.