billy21
asked on
Programatically scheduling a job
This is a continuation of this thread: https://www.experts-exchange.com/questions/21182637/Executing-an-overnight-process.html
I know I can schedule a job via the command prompt that's fine however, how do I programatically check if the job already exists? I need to know for sure that the job doesn't exist before I create the job.
Any ideas?
Thanks in Advance,
Bill
I know I can schedule a job via the command prompt that's fine however, how do I programatically check if the job already exists? I need to know for sure that the job doesn't exist before I create the job.
Any ideas?
Thanks in Advance,
Bill
You can assign an ID to a job you create. By doing this you can make sure only one exists. (By deleting the job with the ID 1st and then inserting this.
ASKER
I thought of that too but you actually can't assign your own id to a job as far as I can see.
You can...
at [\\Computername] [{[ID] [/delete]|/delete [/yes]}]
There is an optional ID tag :)
at [\\Computername] [{[ID] [/delete]|/delete [/yes]}]
There is an optional ID tag :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
rdrunner,
at [\\Computername] [{[ID] [/delete]|/delete [/yes]}]
That is the syntax for deleting. There is another syntax example for creating and it does not include id. You need to specify id in deleting so AT knows which item to delete. The syntax for creating an item is...
at [\\computername] time [/interactive] [/every:date[,...] ¦ [/Next:date[,...]] "command"
at [\\Computername] [{[ID] [/delete]|/delete [/yes]}]
That is the syntax for deleting. There is another syntax example for creating and it does not include id. You need to specify id in deleting so AT knows which item to delete. The syntax for creating an item is...
at [\\computername] time [/interactive] [/every:date[,...] ¦ [/Next:date[,...]] "command"
Oops...
true :)
But i like the link emoreau posted :) (Its added to my bookmarks now)
true :)
But i like the link emoreau posted :) (Its added to my bookmarks now)