scheduled task run .exe problem

2019-06-02 02:01发布

问题:

I have a c# console app that writes some text to a txt file when runs. I have added it in scheduled task. the task runs without error on a scheduled time... but the console window dose neither pop up nor any text in the destination file!

any idea where is the problem? I'm on windows server 2008 r2.

回答1:

The console does not show because the scheduled task does not run as an interactive user. Text is not written in the dest file because probably it is not accessible by the user running the scehduled task ( maybe is some mounted remote disk ? ). If your c# app is written by your own, try to put some more log to understand what happens.



回答2:

The console does not show if you selected "Run whether user is logged on or not". If you set it "Run only when user is logged on" it will popup and run in interactive mode.