Hey guys,
I'd like to know is it possible, and if it is then how, to run an exe file on schedule (specifed date and time) ?
I suppose it should be written in the registry somehow, but how and where?
Thank you,
Nebo
Printable View
Hey guys,
I'd like to know is it possible, and if it is then how, to run an exe file on schedule (specifed date and time) ?
I suppose it should be written in the registry somehow, but how and where?
Thank you,
Nebo
You can use SchTasks.exe for this, which allows you to manipulate Windows Scheduled Tasks. Look in the Windows help for the correct syntax and then use Process.Start to issue the commands required to create or edit your job.
Edit:
Just to note, if you're talking about running your EXE on a schedule then use the above method. If you're talking about running a different EXE, then you can use a Timer in your app to run anything else on schedule.
Thanks jmcilhinney, I found it in Help File, and looked at its syntax, but I really don't understand how to use it.
Please, if you can, write just a small code example.
Thanks,
Nebo
I'm afraid I've never used it in anger. I intended to but there was apparently an issue with my Windows installation. I had reserached it all and started writing code but I was geting some odd exceptions. I tried the same code on another installation on a different partition and there was no issue. I concluded that it was an OS issue and scrapped the plan until my next machine upgrade. This was all some time ago and I haven't bought a new system yet so I haven't gone back to it. All I can recommend is that you experiment, which is what I did.