Winforms app as Scheduled task

2019-08-09 05:36发布

问题:

I've got a winforms app that I developed to do batch processing on tens of thousands of students, now we're trying to run it nightly as a scheduled task.

I personally find it useful to be able to login to the box and see how it's processing by looking at the GUI, though the standard way it to convert it into a commandline app.(which radically limits the amount of screen realestae I can use for loggin messages)

Can I run the app as a schedueld task, the IT Guy whos scheduling says it's not running because it's a winform app. Are there any tricks needed to get it to run well, or am I forced to rewrite it as a commandline app with it's 80 char width limit.

Basicaly I just echo the log file to the screen in realtime to make debugging issues easier. So the gui is output only.

Its' running as the currently loggedin user, but the issue is that it does not run if the user is not currently logged in on the box,so when we leave for the night it fails to run.

Thanks,

Eric-

回答1:

You need to make sure it is running as the currently logged in account. If it runs as 'system' I don't think it will show up correctly.

I have one of these myself... and despise it. It only exists because I haven't had a chance to rewrite it into a proper service. Don't forget there are more ways to log than just outputting to the console. ;)