Share via

How to execute scripts in my system?

Anonymous
2025-03-02T17:13:38+00:00

I have the following error:

The execution of scripts is unable in my system**. For get more information, consult the following topic: about_Execution_Policies**

Windows for home | Windows 10 | Performance and system failures

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2025-03-02T21:01:57+00:00

    This error may occur because the Windows PowerShell execution policy is set to prevent untrusted scripts from affecting your Windows client environment. The default execution policy is “strict” on client operating systems like Windows 10/11 PC, preventing Windows PowerShell commands and scripts from running.

    Open the PowerShell Console by selecting “Run as Administrator” (Or Right-click the Start menu and choose “Windows PowerShell (Admin)” from the context menu) and get the execution Policy with the command:

    Get-ExecutionPolicy

    This will get the current script execution policy applied, such as “Restricted” which means PowerShell scripts are disabled.

    Set the execution Policy with the following command:

    Set-ExecutionPolicy RemoteSigned

    You’ll see a security risk warning. Type “Y” or “A” when prompted to proceed.

    Now run try to run your script.

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2025-03-02T20:52:06+00:00

    Open PowerShell.

    Run the script.

    powershell -File "C:\path\to\your\script.ps1"

    Replace the path with the actual path of the .ps1 script.

    Let me know how it goes.

    I execute the .bat script and .ps1 script but then system not permit execute script.

    I have the following error message:

    The execution of script is disabled in this system. For get more information, consult the topic: about_Execution_Policies

    What happening?

    0 comments No comments
  2. Anonymous
    2025-03-02T20:14:38+00:00
    1. A .bash script is typically meant for Unix-like systems (e.g., Linux, macOS). To run it from PowerShell, you need a Bash interpreter like Windows Subsystem for Linux (WSL).

    https://apps.microsoft.com/detail/9PDXGNCFSCZV?...

    If you have WSL installed:

    Open PowerShell.

    Run the following command:

    wsl bash /path/to/your/script.bash

    Replace /path/to/your/script.bash with the actual path to your .bash script.

    1. A .ps1 script is a PowerShell script and can be executed directly in PowerShell.

    Open PowerShell.

    Run the script.

    powershell -File "C:\path\to\your\script.ps1"

    Replace the path with the actual path of the .ps1 script.

    Let me know how it goes.

    0 comments No comments
  3. Anonymous
    2025-03-02T20:04:59+00:00

    I want execute .bat script and .ps1 script from CMD and POWERSHELL

    I execute the following script:

    shutdown -s -t 15   
    

    But execute a loop of the command

    Image

    0 comments No comments
  4. Anonymous
    2025-03-02T17:45:31+00:00

    Greetings. My name is Anis. I'll be glad to help you today.

    May I know what kind of script you are trying to execute?

    For example VBS script, .Bat script etc..

    0 comments No comments