i have ms word automation c# program cpu hungry, loops through records in db, opens word, mail merge individual record, kills winword.exe , loops next record. when run program directly command promtt, spike 100% cpu while doing mail merge, , cpu drop , happy enough this.
but when schedule task through windows task scheduler (win server 2008 r2) cpu spikes 100% , remains constant , program bombs out without finishing. have ideas why there differences between running program through task scheduler compared manually through command prompt?
perhaps runs user when schedule it? can cause problems permissions? environment variables? default running folder differences?
can write very simple word automation , see if suffers same issue? let know if problem way run or run.
the comments other people wrote correct - should log , see causes trouble.
also - killing winword.exe can cause trouble don't want - file recovery dialogs. recommend closing document , word , wait winword.exe exit. if fails kill it, ready handle trouble.
vadim.
Comments
Post a Comment