I have this simple script on Windows 10, which works fine when just executing, but fails to start notepad when running from task scheduler. Stop-Process works perfectly, Start-Process does not run. When I run it on demand, it closes the notepad and then keeps running without opening notepad, the task does not close also.
Stop-Process -processname notepad
Start-Process "C:\Windows\system32\notepad.exe"
This is how it is configured to run.
Things I have tried, but still does not work.
-ExecutionPolicy Bypass and -ExecutionPolicy RemoteSignedLogon as batch job permissionThe application was ran in background. To make it run on foreground, had to check the box Run only when user is logged on.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With