简体   繁体   中英

Command prompt not showing when PowerShell script run from task schduler

I have a C# application that opens a command prompt and displays connection status'. I have a PowerShell script that checks if the process is running and starts it if not. If I run the script manually, the command promt opens. When I have task scheduler run the script, it starts the application and all the background processes function properly, but the command prompt does not open. How do I get the command prompt to open when the PowerShell script is run from task scheduler.

This is being done on a Windows 7 machine using PowerShell 4.0. It has been moved from another from another windows 7 machine where it was fully functioning. All the settings in task manager are identical.

I found the issue to be that the task needed to be set for "run only when user is logged in" and then it worked. Apparently not ALL settings were the same in task scheduler.

More Here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM