FIX: Running scripts is disabled on this system on Windows 10/11

.single .post-author, .post-date {
text-transform: none;
}

In Windows 10/11, the error message “script cannot be loaded because running scripts is disabled on this system” occurs when you try to run a PowerShell script but the operating system has restricted script execution for security reasons.

The default PowerShell execution policy is a security feature that prevents malicious scripts from running. However, if you are trying to run a script that you or someone else has created and it is not malicious, you can override this security policy by allowing the script to run by following the instructions below.

But before proceeding to change the Execution Policy of running scripts, is good to know the all the types of the execution policies:*

  • Restricted: This is the default policy for Windows clients and prevents running any scripts.
  • RemoteSigned: This policy allows to run scripts written on the local computer but prevents the execution of scripts that are downloaded from the internet and they are not signed.
  • AllSigned: This policy allows you to run only scripts signed by a trusted publisher, including scripts that you write on the local computer.
  • Unrestricted: This policy allows to run all scripts (signed or unsigned), but puts your computer under security risks.
  • Default: Sets the default execution policy, which is “Restricted” for Windows clients & “RemoteSigned” for Windows servers.

* Source: Microsoft: About Execution Policies.

How to FIX: Running scripts is disabled on this system on Windows 11/10.

On a Windows computer, you can change the default execution policy for a specific session or script, for all scripts, for the current user, or for all users on the computer via Windows Settings, PowerShell or Group Policy.

  1. Allow Scripts to Run in Windows 11 Settings.
  2. Allow Scripts Execution in PowerShell.
  3. Permit Scripts to Run in Group Policy.
  4. Check Current Execution Policy in PowerShell.
  5. Reset Execution Policy to Default from PowerShell.

Method 1. FIX “Running Scripts is disabled” in Windows 11 Settings.*

* Note: This method applies only to Windows 11. For Windows 10, skip to next methods.

1. Go to Start > Settings and open Privacy and security*
2a. In Privacy and Security settings, click For developers.

FIX: Script cannot be loaded because running scripts is disabled on this systemFIX: Script cannot be loaded because running scripts is disabled on this system

2a. Scroll down and then expand the PowerShell options.
2c. Turn On the Change the execution policy to allow local PowerShell scripts to run without signing. Require signing for remote scripts.

FIX: Running scripts is disabled on this system on Windows 10/11FIX: Running scripts is disabled on this system on Windows 10/11

Method 2. FIX: Running Scripts is disabled in PowerShell (Windows 10/11).

To change the execution policy through PowerShell, use these instructions:

1. Bypass “Running scripts is disabled” error for the current session.

If you want to bypass the default script execution policy only for the specific session, give the following command and then execute your script:

  • Powershell -ExecutionPolicy Bypass

 change execution policy powershellchange execution policy powershell

 

2. Bypass “Running scripts is disabled” error for the current script:

If you want to bypass the default script execution policy only for the specific script, give the following command:

  • Powershell -ExecutionPolicy Bypass -File script.ps1

allow script to run powershellallow script to run powershell

 

3. Change the Execution Policy for All Users.

If you want to allow the execution of scripts for all users on the PC, open PowerShell or Terminal as Admin and give one of the following commands according what do you want to do:

A. To allow locally-created scripts to run (even unsigned), or scripts downloaded from the Internet but signed by a trusted publisher, issue one of these commands:

  • Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

allow scripts to run powershellallow scripts to run powershell

  • Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

imageimage

 

B. To allow all scripts to run, even the unsinged scripts downloaded from Internet, give the following command:*

  • Set-ExecutionPolicy -ExecutionPolicy Unrestricted

* Important: The above command puts your computer at risk because it allows all scripts to run, even malicious ones.

allow all scripts to run powershellallow all scripts to run powershell

 

4. Set Execution Policy for the current user.

A. If you want to allow locally generated scripts (even unsigned) or downloaded signed scripts to run only for the currently logged in user, issue this command in PowerShell (Admin):

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

imageimage

B. If you want to allow all scripts to run (the unsinged scripts downloaded from Internet), only on the currently logged in user, give the following command:*

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser

* Important: The above command puts your computer at risk because it allows all scripts to run, even malicious ones.

imageimage

<.p>

Method 3. Allow Scripts to Run in Group Policy.

If you’re running Windows 10/11 Pro, you can change the Execution Policy in Group Policy as follows:

1. Press Windows imageimage + R keys to open the run command box.
2. Type gpedit.msc  and press Enter to open the Group Policy Editor

imageimage

 

3. In Policy Editor, go to the following path from the left:

Computer Configuration > Administrative Templates > Windows Components > Windows PowerShell

4a. At the right pane, double-click to open the Turn on Script Execution policy.

FIX: Running scripts is disabled on this system in Group Policy FIX: Running scripts is disabled on this system in Group Policy

 

4b. Set the Policy to Enabled and then from the ‘Execution Policy’ drop-down menu, select Allow local scripts and remote signed scripts. Then click Apply & OK to save your setting.*

* Note: To disallow scripts to run set this policy back to Not Configured.

Allow local scripts and remote signed scripts Allow local scripts and remote signed scripts

How to Check the Current Execution Policy.

1. Open PowerShell or Windows Terminal as Administrator:

imageimage

2. To view the current execution policy on a Windows 10/11 machine, give this command:

  • Get-ExecutionPolicy

check current execution policycheck current execution policy

3. To get all of the execution policies that affect the current session, issue this command:

  • Get-ExecutionPolicy -List

view current execution policiesview current execution policies

How to Set the Default Execution Policy on Windows 10/11.

If after running your scripts, you want to reset back the execution policy back to its default setting, do the following:

1. Open PowerShell or Windows Terminal as Administrator & give the following command:

  • Set-ExecutionPolicy Default

Set default Execution PolicySet default Execution Policy

 

That’s all folks! Please leave a comment in the comment section below or even better: like and share this blog post in the social networks to help spread the word about this solution.

If this article was useful for you, please consider supporting us by making a donation. Even $1 can a make a huge difference for us.

Hình ảnh thuộc sở hữu của trang web qnet88.comHình ảnh thuộc sở hữu của trang web qnet88.com
  • Author
  • Recent Posts
Konstantinos TsoukalasKonstantinos Tsoukalas
Konstantinos Tsoukalas
Konstantinos is the founder and administrator of Repairwin.com. Since 1995 he works and provides IT support as a computer and network expert to individuals and large companies. He is specialized in solving problems related to Windows or other Microsoft products (Windows Server, Office, Microsoft 365, etc.).
Konstantinos TsoukalasKonstantinos Tsoukalas
Latest posts by Konstantinos Tsoukalas (see all)
  • FIX: Running scripts is disabled on this system on Windows 10/11 – February 15, 2024
  • FIX: Device is Missing Important Security and Quality Fixes in Windows 11/10. – February 13, 2024
  • FIX: Facebook Messenger forces to create a PIN to access chat history. (Solved) – February 7, 2024

Đánh giá post
[related_posts_by_tax posts_per_page="6" title="Bài liên quan" taxonomies="category,post_tag"]

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Hotline: 0974.0707.83(Zalo/Viber)