I want to alter my database backing up program to wait to run until around midnight and I don't know how to do it. Can someone link me to some usefull information or give me some direction on how to go about doing this?? Thanks!
Sounds like you need to write an out-of-process component, in the form of an ActiveX exe, which will fire an asynchonous event to notify the program of the time change. You can do this in-process as well, but I'm sure your program has enough things to worry about! Anyway, look in the MSDN documentation on component programming and read up on the Coffee Watch example. This will take care of you, however if there are simpler ways to do this... by all means, take suggestions from other posters. I know this is the way I'd personally go about it! Thanks!
LeGo PiEcE
"The Computer Spock! Destroy it!" - Captain James T. Kirk
You don't need that much precision, so try the
caveman approach
Do until canceled
figure_out_next_time_to_wake_up
Do until time_to_wake_up
Sleep(30000) 'sleep 30 seconds
time_to_wake_up =( _
Now() = time-of-next-event)
loop
The easiest way to do this is just to stick all of your code into "Sub Main()" in a module, compile your EXE, and schedule it, like someone mentioned above. I do this quite frequently for all of my little utilities.. but i normally use VBScript for my "nightly tasks", just because i can make a change to it in the blink of an eye, and from any computer i might be at.
Just beware.. when you use the windows scheduling service, on NT4, Win2K, or whatever, you need to set the properties of your scheduled job to include the necessary network account/login - so that the job runs with the correct permissions for you to access network drives. And speaking of network drives, your network drives might not exist under this condition, and you may have to refer to the complete UNC (\\servername\share\path), or just remap your drive at the time of job execution.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.