Windows scheduling

  • Thread starter Thread starter Alan T
  • Start date Start date
A

Alan T

I would like to write a desktop application to create a windows job, say to
run an myApp.exe at 9pm everyday.
Any API or other function I can call?
 
Alan T said:
I would like to write a desktop application to create a windows job, say to run an
myApp.exe at 9pm everyday.
Any API or other function I can call?


Why not simply execute taskschd.exe using System.Diagnostics.Process.Start?

Willy.
 
John Timney (MVP) said:
Why not use task scheduler given it already does what your asking for!

He's asking what function to use to programmatically create task scheduler
jobs.

I don't know a managed solution, but you can p/invoke

NetApiBufferFree
NetScheduleJobAdd
NetScheduleJobDel
NetScheduleJobEnum
NetScheduleJobGetInfo
 
Shell to the "AT" command. The cmd shell's AT command is a complete command
line interface to the Windows Task Scheduler.

Mike Ober.
 
Michael D. Ober said:
Shell to the "AT" command. The cmd shell's AT command is a complete command line
interface to the Windows Task Scheduler.

Schtasks.exe is the successor of the at.exe command line utility, it offer far more options
than "at" and is also the command shell of the task scheduler on Vista and longhorn.

Willy.
 
Hi,

I would like to write a little program to display a form with a text box for
user to fill in the time, eg. 9 pm.
When the user click the 'OK' button I will create a window scheduled job to
exeute the myApp.exe at 9pm every day.

What will be the code to create the scheduled job?
 
use SQL Server; it comes with SqlAgent.

it is 100 times more powerful than anything else mentioned here
 
Hi,

My client may not have SQL Server so my option is to schedule Windows job.
 
your client may not have SQL Server?

then give them free MSDE 2.0


I think that we all should boycott SQL 2005 Express until they put SQL
agent back in it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top