Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Windows Tutorials»How to Fix “Running scripts is disabled on this system” PowerShell Error

    How to Fix “Running scripts is disabled on this system” PowerShell Error

    By RahulApril 11, 20233 Mins Read

    PowerShell is a powerful scripting language and automation tool that comes built-in with Windows operating systems. It allows users to automate tasks, manage system configurations, and interact with various services. However, when running PowerShell scripts, you may encounter the error “Running scripts is disabled on this system”. This error occurs due to PowerShell’s default execution policy, which is set to Restricted, preventing any scripts from being executed to enhance system security.

    Advertisement

    In this article, we will explore the different execution policies in PowerShell and guide you through the process of resolving this error to enable script execution.

    Understanding PowerShell Execution Policies:

    PowerShell features four primary execution policies that determine the conditions under which scripts can be executed:

    • Restricted: This is the default policy and prevents running any scripts. You can still use PowerShell for individual commands but cannot execute scripts.
    • AllSigned: This policy allows you to run scripts that have been digitally signed by a trusted publisher. Any unsigned scripts will not be executed.
    • RemoteSigned: This policy enables you to run locally-created scripts, while scripts downloaded from the internet must be signed by a trusted publisher to execute.
    • Unrestricted: This policy permits the execution of all scripts, regardless of their origin or whether they are signed. This setting may pose security risks, so use it with caution.

    Error:

    This error comes when the PowerShell execution policy doesn’t allow us to run scripts. I also found the same error when tried to run a PowerShell script.

    PowerShell – Running scripts is disabled on this system
    PowerShell Error– Running scripts is disabled on this system

    Solution:

    To resolve the “Running scripts is disabled on this system” error, you need to change the execution policy. Follow these steps:

    1. Launch PowerShell with administrative privileges: Click on the Start menu, type “PowerShell”, right-click on “Windows PowerShell,” and select “Run as administrator”.
    2. Check the current execution policy: To verify the current policy, run the following command:

      1
      Get-ExecutionPolicy

    3. Change the execution policy: To change the policy, use the `Set-ExecutionPolicy` cmdlet, followed by the desired policy. For example, to set the execution policy to RemoteSigned, run:

      1
      Set-ExecutionPolicy RemoteSigned

      You will be prompted to confirm the change. Press “Y” and then Enter to confirm.

    4. Verify the new policy: Run `Get-ExecutionPolicy` again to ensure that the policy has been changed successfully.
    5. Close and reopen the PowerShell window to apply the changes.

    Note: It is essential to understand the security implications of changing the execution policy. Be cautious when selecting a policy, as it may expose your system to potential risks. The RemoteSigned policy is a good balance between security and functionality for most users.

    Conclusion:

    In this article, we have explored PowerShell execution policies and provided a step-by-step guide on resolving the “Running scripts is disabled on this system” error. By changing the execution policy, you can enable the running of PowerShell scripts on your system while still maintaining an appropriate level of security. Remember to exercise caution when choosing an execution policy and always run scripts from trusted sources to protect your system from potential threats. With the error resolved, you can now harness the full power of PowerShell scripts to automate tasks and manage your system more efficiently.

    Policy PowerShell security
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    A Step-by-Step Guide to Installing Nginx on Windows

    12 Tips to Secure Your MySQL Database Server: Best Practices and Techniques

    A Step-by-Step Guide to Secure MySQL Server with SSL/TLS

    View 17 Comments

    17 Comments

    1. sara on August 3, 2022 4:29 pm

      Thanks for the tutorial
      I tried to write the command and the response was:
      ‘Set-ExecutionPolicy’ is not recognized as an internal or external command,
      executable program or batch file.

      Reply
    2. Rohit on October 6, 2021 1:08 pm

      Very good website my problem is solution

      Reply
    3. Walid Sahnoun on September 22, 2021 8:54 am

      Thanks it worked

      Reply
    4. Sulaiman on September 13, 2021 12:44 pm

      This fixed it for me on Windows 10 running in Parallels on a Macbook. Thanks for sharing this, a great help!

      Reply
    5. shubham on May 6, 2021 6:43 pm

      tnx dude it helps

      Reply
    6. Nim on January 13, 2021 4:47 am

      Mine didn’t work. This is the error

      Get-Process : A positional parameter cannot be found that accepts argument ‘Set-ExecutionPolicy’.
      At line:1 char:1
      + PS C:\> Set-ExecutionPolicy RemoteSigned
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidArgument: (:) [Get-Process], ParameterBindingException
      + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetProcessCommand

      Reply
      • Fred Wens on February 24, 2021 4:26 pm

        Run as admin; that should do it

        Reply
        • sdf on April 13, 2021 6:21 am

          same error with admin

          Reply
          • Robert on April 26, 2021 3:01 pm

            You are using Get-Process ? May we see your full command?

            All you should be entering is:

            Set-ExecutionPolicy RemoteSigned

            Reply
    7. Akib Zaman on October 12, 2020 5:14 pm

      verry verrrrrrrrryyyyyyyyyyyyyyyyy helpful
      thnaks

      Reply
    8. SUSUDA on June 21, 2020 1:28 pm

      Thanks for your explanation about PS policy, It help me alot.

      Reply
    9. Atal on April 29, 2020 7:43 pm

      thanks it worked for me

      Reply
    10. Nasir Aslam on October 27, 2019 4:33 pm

      how we can on window 10 plz tell me step by step

      Reply
    11. Michal on October 25, 2019 8:24 am

      Hi,
      please just notice that it need to be set separately for x86 and x64 versions of powershell.

      Reply
    12. Rajkumar Pandey on August 12, 2019 6:26 am

      Hi,RAHUL

      Thank You So Much For PowerShell – Running scripts is disabled on this system. You Explanation is good.

      Reply
    13. viki on May 16, 2019 7:06 am

      will this script work on windows 7 ?

      Reply
      • V-Nayak on September 6, 2019 10:30 am

        yes it will

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • A Comprehensive Look at the Simple Mail Transfer Protocol (SMTP)
    • Understanding Basic Git Workflow: Add, Commit, Push
    • The Difference Between Git Reset –soft, –mixed, and –hard
    • Understanding the Staging Area in Git’s Workflow
    • Python Function with Parameters, Return and Data Types
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.