samsmithnz Posted December 2, 2003 Posted December 2, 2003 I need to create an application that runs late every night, and processes some files (where there can be 0 to n files). I really don't need an interface. I'm looking at options. I was investigating a Windows Service, except that it doesn't seem to have any built in scheduling functionality. Am I missing something? Or should I go ahead and build a interface-less VB.NET app? OR are there other options I haven't thought of yet??? Quote Thanks Sam http://www.samsmith.co.nz
*Gurus* Derek Stone Posted December 3, 2003 *Gurus* Posted December 3, 2003 Under most circumstances the correct solution is to schedule a task (Control Panel | Scheduled Tasks | Add Scheduled Task). Quote Posting Guidelines
samsmithnz Posted December 3, 2003 Author Posted December 3, 2003 Well obviously I'd do that if it was an application, but the application doesn't require an interface. I guess I can create a VB app without any forms... Quote Thanks Sam http://www.samsmith.co.nz
Mehyar Posted December 3, 2003 Posted December 3, 2003 You can create a windows service with a timer to execute code every certain period of time. Thus acheiving your goals (no interface, and scheduled) Hope this helps, Quote Dream as if you'll live forever, live as if you'll die today
samsmithnz Posted December 3, 2003 Author Posted December 3, 2003 Except that I'd have to set the timer to 60,000 seconds or something to run once a day. Quote Thanks Sam http://www.samsmith.co.nz
Jay1b Posted December 3, 2003 Posted December 3, 2003 and whats the problem with setting the timer to 60,000 seconds?(assuming the timer can handle that much - which i am sure it can) If you dont want to have the timer looping that much, have the timer count to 60 seconds, every time it reaches 60, add 1 to an integer. If integer = 1440 (minutes in day) - then activate the event, and set the integer to 0. Quote
samsmithnz Posted December 3, 2003 Author Posted December 3, 2003 Its just not as configurable as I would have liked. I think I'll go with an interface-less VB app, and use the Scheduler to run it when I need too. Quote Thanks Sam http://www.samsmith.co.nz
Jay1b Posted December 3, 2003 Posted December 3, 2003 Well you can run it from a command line if you would like it any different, by adding a parameter afterwards. Quote
VBAHole22 Posted July 19, 2004 Posted July 19, 2004 sam, what did you wind up going with here? I have an app with no true interface that I want to run nightly or possibly weekly. Did you go with the task scheduler? Do you just tell the scheduler the name of the .exe? Quote Wanna-Be C# Superstar
samsmithnz Posted July 19, 2004 Author Posted July 19, 2004 Yeh I did go with Windows Task Schedulerin the end. The task scheduler calls the executable when required and the application processes some files and then imports the data into SQL. very simple really. Sam Quote Thanks Sam http://www.samsmith.co.nz
VBAHole22 Posted July 20, 2004 Posted July 20, 2004 Good Deal. I am testing out something like that right now. It is a win app that had a GUI but I just took the relevant subs and I call them from the Form_Load event. Seems like a hack but I think it is working. I suppose I could strip out all of the GUI controls but I am always going to need to have that form in there to access the Load event, right? Quote Wanna-Be C# Superstar
samsmithnz Posted July 20, 2004 Author Posted July 20, 2004 Actually no, you don't need a form in a windows application. Add a module, add a sub main, and then change your project properties to run the sub main first instead of form_load. Quote Thanks Sam http://www.samsmith.co.nz
VBAHole22 Posted July 20, 2004 Posted July 20, 2004 Ah yes. I see said the blind man. Thank you. That will save me some overhead. Quote Wanna-Be C# Superstar
samsmithnz Posted July 20, 2004 Author Posted July 20, 2004 To the deaf lady on the the telephone? Quote Thanks Sam http://www.samsmith.co.nz
*Experts* Nerseus Posted July 20, 2004 *Experts* Posted July 20, 2004 You can use the Windows Task Scheduler (as mentioned). An alternate approach, available if you're using SQL Server, is to use a sqltask. It works similarly to the Windows Task Scheduler (very robust) and has the advantage that you can easily change the scheduling (turn on/off, time of day, etc.). Interfacing with the Windows Task Scheduler, in my past experience, has been difficult. Interfacing to the sqltask scheduler is a breeze. And, since you're loading data into SQL (SQL Server?), it would make sense to make this a sql job. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
VBAHole22 Posted July 20, 2004 Posted July 20, 2004 Interfacing with the Windows Task Scheduler, in my past experience, has been difficult Not sure what you mean by this. Do you mean programatically? I am just setting it up through the GUI and it seemed really simple. Unfortunately I am in Oracle. Seems like I switch back and forth about every three weeks. That's good and bad at the same time. Quote Wanna-Be C# Superstar
*Experts* Nerseus Posted July 21, 2004 *Experts* Posted July 21, 2004 Yes, I meant programmatically. If you have the need, sql tasks are easier to program against. Plus, since this is technically an sql task, it seems fitting to go there. But, a windows task is super easy to setup as well and works quite well. Just offering up another option since many probably don't know that SQL Server supports setting up scheduled tasks. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.