Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. $menu = 'Open Windows PowerShell Here as Administrator'
  2. $command = "$PSHOME\powershell.exe -NoExit -NoProfile -Command ""Set-Location '%V'"""
  3.  
  4. 'directory', 'directory\background', 'drive' | ForEach-Object {
  5. New-Item -Path "Registry::HKEY_CLASSES_ROOT\$_\shell" -Name runas\command -Force |
  6. Set-ItemProperty -Name '(default)' -Value $command -PassThru |
  7. Set-ItemProperty -Path {$_.PSParentPath} -Name '(default)' -Value $menu -PassThru |
  8. Set-ItemProperty -Name HasLUAShield -Value ''
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement