Windows 11 PowerShell script double-click execution method

This article will demonstrate how to enable double-click execution of PowerShell scripts (.ps1 files) on Windows 11. Follow the steps below:

1. Download and extract the SetUserFTA tool:https://kolbi.cz/SetUserFTA.zip

2. Open CMD as administrator and run the following command (for Windows PowerShell):

ftype Microsoft.PowerShellScript.1="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -ExecutionPolicy Bypass -f "%1"

3. Use the SetUserFTA tool with the following parameters:

SetUserFTA.exe.ps1 Microsoft.PowerShellScript.1

If you prefer using PowerShell 7, replace the command in step 2 with:

ftype Microsoft.PowerShellScript.1="C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -ExecutionPolicy Bypass -f "%1"

After completing these steps, you can double-click .ps1 files to execute them on Windows 11.

References:
https://www.elevenforum.com/t/run-ps1-files-double-click-on-windows-11.2433/

Posted in 軟體, 軟體操作筆記 and tagged .

Leave a Reply

Your email address will not be published. Required fields are marked *