running scripts is disabled Windows Origin: Platform & cloud OSI layer 7 · Application Last updated 13 Oct 2026

File cannot be loaded because running scripts is disabled on this system (PowerShell execution policy)

PowerShell’s execution policy blocks .ps1 scripts — including npm/yarn/pnpm shims like npm.ps1.

Exact message you may see running scripts is disabled on this systemcannot be loaded because running scripts is disabled
Seen on: Windows

Meaning

Windows defaults to Restricted on client machines. Tools installed via npm, Python venv Activate.ps1 and other scripts fail until the policy allows local scripts. Organisations may enforce policy via GPO.

Common causes

  • Execution policy Restricted (default on Windows clients)
  • Script downloaded from the internet (Zone.Identifier) under RemoteSigned
  • GPO enforcing the policy

⚡ Quick fix

  1. Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
  2. Unblock downloaded scripts (Unblock-File)
  3. Use npm.cmd or bypass for one run: powershell -ExecutionPolicy Bypass -File script.ps1

Detailed fix by platform

PowerShell

  1. powershell
    Get-ExecutionPolicy -List
    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
    Unblock-File .\script.ps1

How to diagnose

  1. Policy — Get-ExecutionPolicy -List (which scope wins)
  2. GPO — MachinePolicy/UserPolicy set?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

0x800704EC — 0x800704EC: This program is blocked by group policy (Windows Defender) (Windows)0x800704EC1005 — Cloudflare Error 1005: Access denied — The owner of this website has banned the autonomous system number (ASN) your IP address is in (Cloudflare)100515281 — SQL Server Msg 15281: SQL Server blocked access to procedure 'sys.xp_cmdshell' (component 'xp_cmdshell' turned off) (SQL)15281403 Forbidden wp-admin — WordPress: 403 Forbidden on wp-admin, wp-login.php or admin-ajax.php (WordPress)403 Forbidden wp-adminAADSTS50053 — AADSTS50053: Your account is locked (Smart Lockout) / sign-in blocked due to suspicious activity (Azure)AADSTS50053antiforgery token could not be decrypted — ASP.NET Core: The antiforgery token could not be decrypted / The required antiforgery cookie is not present (400 Bad Request) (.NET)antiforgery token cou…command not found — bash: command not found (Linux)command not foundCredSSP encryption oracle remediation — Remote Desktop: An authentication error has occurred. The function requested is not supported. This could be due to CredSSP encryption oracle remediation (Windows)CredSSP encryption or…running s…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.