Last active
June 11, 2022 12:29
-
-
Save Serat00l951/63dc2e9c34fe4e093f544b0afa7bbf20 to your computer and use it in GitHub Desktop.
Start powershell scripts with double click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Run this with admin rights! | |
rem Запускать от имени администратора! | |
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force}" | |
ftype Microsoft.PowerShellScript.1="C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe" "%%1" | |
assoc .ps1=Microsoft.PowerShellScript.1 | |
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1" /f | |
reg add "HKCR\Microsoft.PowerShellScript.1\shell\runas" /f | |
reg add "HKCR\Microsoft.PowerShellScript.1\shell\runas" /v "HasLUAShield" /t REG_SZ /f | |
reg add "HKCR\Microsoft.PowerShellScript.1\shell\runas\command" /f | |
reg add "HKCR\Microsoft.PowerShellScript.1\shell\runas\command" /ve /t REG_SZ /d "\"C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe\" \"%%1\"" /f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment