Skip to content

Instantly share code, notes, and snippets.

@Serat00l951
Last active June 11, 2022 12:37
Show Gist options
  • Save Serat00l951/ce8710f2111244ab70b4db383a539064 to your computer and use it in GitHub Desktop.
Save Serat00l951/ce8710f2111244ab70b4db383a539064 to your computer and use it in GitHub Desktop.
Disable starting powershell scripts with double click
rem Run this with admin rights!
rem Запускать от имени администратора!
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy Restricted -Force}"
ftype Microsoft.PowerShellScript.1="C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe" "%%1"
assoc .ps1=Microsoft.PowerShellScript.1
reg delete "HKCR\Microsoft.PowerShellScript.1\shell\runas" /f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment