Winforms app as Scheduled task

被刻印的时光 ゝ 提交于 2020-01-24 21:04:51

问题


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. ;)



来源:https://stackoverflow.com/questions/5793771/winforms-app-as-scheduled-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!