Enable or disable PowerShell script execution on Windows in one click.
Sets Unrestricted mode, disables UAC & Smart App Control, and unblocks all files in the script directory.
A revert option restores Restricted mode at any time. Everything is safe and fully reversible.
Right-click Set-PSExecution.bat β Run as administrator
The script will automatically request administrator privileges, then prompt you to choose an action.
| Option | Action |
|---|---|
1 |
Enable β Unrestricted mode + UAC off + Smart App Control off + Unblock files |
2 |
Revert β Restricted mode only |
Important
A restart is required after applying changes for them to take full effect.
If you prefer doing it manually, open PowerShell as administrator and run:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser -ForceNote
If Windows still blocks the script after this, a Group Policy is overriding the setting. Use the .bat instead β it bypasses GPO directly via the registry.
| Action | Description |
|---|---|
| Unrestricted Mode | Allows all .ps1 scripts to run regardless of signature or origin |
| UAC Disabled | Removes elevation prompts to allow seamless script automation |
| Smart App Control Disabled | Stops Windows 11 from blocking unrecognized scripts and apps |
| File Unblocking | Removes the Zone.Identifier tag from files downloaded from the internet |
| Registry Keys | Modifies execution policy, PowerShell logging and system restriction entries |
βΊ Unrestricted Mode
By default, Windows blocks all .ps1 scripts from running. Unrestricted mode removes this restriction entirely, allowing any script to execute regardless of its origin or signature.
The script applies this at both the user level and machine level, and also overrides any Group Policy that might enforce a stricter setting.
βΊ UAC (User Account Control)
The UAC prompt appears every time an app tries to make changes to your system. Disabling it prevents these interruptions so scripts can run without requiring manual approval each time.
Disabling UAC reduces a layer of Windows security. Revert to default settings or re-enable it once you no longer need unrestricted access.
βΊ Smart App Control
Smart App Control is a Windows 11 feature that blocks apps and scripts it doesn't recognize. Even with Unrestricted mode enabled, SAC can still silently prevent your scripts from running. The script disables it automatically via the registry.
[!CAUTION] Once disabled, Smart App Control cannot be re-enabled without reinstalling Windows.
βΊ Zone.Identifier
When you download a file from the internet, Windows silently attaches a hidden tag called Zone.Identifier. This marks the file as untrusted and causes Windows to block or warn when you try to run it β even with ExecutionPolicy set to Unrestricted. The script removes this tag automatically from all files in its directory.
You can also remove it manually: right-click any file β Properties β check Unblock β OK.
βΊ Registry Keys
| Registry Key | What it controls |
|---|---|
HKCU\...\ShellIds\Microsoft.PowerShell β ExecutionPolicy |
Per-user execution policy |
HKLM\...\ShellIds\Microsoft.PowerShell β ExecutionPolicy |
Machine-wide execution policy |
HKLM\...\Windows\PowerShell β ExecutionPolicy + EnableScripts |
Group Policy override |
HKLM\...\PowerShell\ModuleLogging |
Disables module logging |
HKLM\...\PowerShell\ScriptBlockLogging |
Disables script block logging |
HKLM\...\PowerShell\Transcription |
Disables transcription logging |
HKLM\...\Policies\System β EnableLUA |
UAC on / off |
HKLM\SYSTEM\...\CI\Policy β VerifiedAndReputablePolicyState |
Smart App Control on / off |
Re-run the script and select 2 Revert. This will restore:
- PowerShell
ExecutionPolicyβ Restricted - All PowerShell logging policies β restored
Note
All changes are limited to registry keys and can be undone at any time. Revert does not touch UAC or Smart App Control. No user files are modified.