Tuesday, October 27, 2009

cmdhere on win7

Shift + right-click shows a context menu with additional entries such as Open command window here.

To add Open powershell here with and without elevated privileges:
  1. Windows Registry Editor Version 5.00
  2. [HKEY_CLASSES_ROOT\Directory\shell\ps]
  3. @="Open powershell here"
  4. [HKEY_CLASSES_ROOT\Directory\shell\ps\command]
  5. @="C:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
  6. [HKEY_CLASSES_ROOT\Directory\shell\Runas]
  7. @="Open admin powershell here"
  8. [HKEY_CLASSES_ROOT\Directory\shell\Runas\Command]
  9. @="C:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
  10. [HKEY_CLASSES_ROOT\Drive\shell\ps]
  11. @="Open powershell here"
  12. [HKEY_CLASSES_ROOT\Drive\shell\ps\command]
  13. @="C:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
  14. [HKEY_CLASSES_ROOT\Drive\shell\runas]
  15. @="Open powershell admin here"
  16. [HKEY_CLASSES_ROOT\Drive\shell\runas\command]
  17. @="C:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
Keys having runas in their names are the ones that will trigger elevated privileges. So yes, it seems we can only map one elevated command per HKEY_CLASSES_ROOT key...

No comments:

Post a Comment