views:

467

answers:

2

I have a web service which I would like to call on a scheduled basis. Currently, I have a scheduled task setup to execute the call. Here's a link Jon Galloway's post on the topic.

I'm planning to switch this out with a Win Service, simply to appease my boss, but I'm wondering what the advantages are (aside from keeping my job ;).

I personally like the script method due to its simplicity, but am curious to know what I'm missing over a Win Service approach..

A: 

Similar question, great answer: http://stackoverflow.com/questions/390307/windows-service-vs-scheduled-task

Jon
I guess this is the same as the link to Jon Galloway's post. Sorry.
Jon
+1  A: 

Reliability is higher with a Windows Service. It can be set to start when the system starts, and to restart automatically if it fails.

John Saunders
I think I can do all of that with a Scheduled Task.. No?
madcolor
No. Automatic restart on failure?
John Saunders
Also, have you seen how easy it is to write a Windows Service in Visual Studio.NET?
John Saunders
I've thrown some psuedo try/catch code in my script which logs any failures. I guess for my purposes, I wouldn't want it to retry until I'd be able to review the issue. I also think compiling should be left for bigger code/projects.
madcolor
So, you haven't seen how easy it is. Besides, code is easier to refactor and reuse than script is. What kind of script? PowerShell, I hope?
John Saunders
Just a simple .vbs.
madcolor
Seriously. Time to write some code. No wonder your boss wants this. He may even want maintainable code, who knows? :-)
John Saunders
Still haven't given me a good argument to replace my 20 line script with an X amount of lines/compiled Win Service.
madcolor