scheduled task run .exe problem
Asked Answered
O

2

1

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.

Oday answered 20/5, 2011 at 14:38 Comment(3)
Does the application log its activity anywhere? You'll probably have to do some debug logging to see what the application is doing at runtime.Tax
It sounds like there are two problems. It is impossible to diagnose the second one (no text in the file) without a lot more detail.Rondelet
Is it running as a user with proper permission? Does it have permission to the output folder? Do you have any exception handling and is there anything in the event logs?Cloistered
D
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.

Decoct answered 20/5, 2011 at 14:43 Comment(2)
Thanks Felice. all the logs supposed to be written in the txt files.. When I created the scheduled task I have added my windows credentials. I wonder why it is not accessible. and also why task scheduler says the task completed successfully!?Oday
the task probably looks at the .exe exit code, and say success since it is probably 0. Do you write in the file specifying the full name or a relative path ? check this too because if you don't specify a current directory this could be an issue too.Decoct
B
1

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.

Backstay answered 6/1, 2012 at 3:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.