If I paste this into Powershell blue window it runs fine and launches the program
Start-Process “C:\Program Files (x86)\Engine Pro\engine.exe” -ArgumentList "#21#”;
but if I try to run the same command in a script, run.ps1 script, that launches from a scheduled task in Windows, it does nothing
PowerShell.exe -windowstyle hidden -NoProfile -ExecutionPolicy Bypass C:\run.ps1
Does it have something to do with the -ExecutionPolicy Bypass? Do I have to have an Execution policy in the script as well? I really don't know what that is. I know what -windowstyle hidden is but -NoProfile -ExecutionPolicy Bypass I'm not sure why that is there, just found it on another page, but it's all working except for the program launching from within the script.
Thank you.
*.ps1
files as UTF-8 with BOM (or as UTF-16LE), PowerShell will misinterpret it. - mklement0-Command
not-File
, so you may need to usePowerShell.exe -windowstyle hidden -NoProfile -ExecutionPolicy Bypass -File C:\run.ps1
- user6811411& Start-Process "C:\Program Files (x86)\Engine Pro\engine.exe" -ArgumentList "#21#";
worked, Took a while it figure it out. Thanks everyone - Kurt Lane