Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $menu = 'Open Windows PowerShell Here as Administrator'
- $command = "$PSHOME\powershell.exe -NoExit -NoProfile -Command ""Set-Location '%V'"""
- 'directory', 'directory\background', 'drive' | ForEach-Object {
- New-Item -Path "Registry::HKEY_CLASSES_ROOT\$_\shell" -Name runas\command -Force |
- Set-ItemProperty -Name '(default)' -Value $command -PassThru |
- Set-ItemProperty -Path {$_.PSParentPath} -Name '(default)' -Value $menu -PassThru |
- Set-ItemProperty -Name HasLUAShield -Value ''
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement