• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

Programatically scheduling a job

This is a continuation of this thread: http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_21182637.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
0
billy21
Asked:
billy21
  • 3
  • 2
1 Solution
 
rdrunnerCommented:
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.
0
 
billy21Author Commented:
I thought of that too but you actually can't assign your own id to a job as far as I can see.
0
 
rdrunnerCommented:
You can...

at [\\Computername] [{[ID] [/delete]|/delete [/yes]}]

There is an optional ID tag :)
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
Éric MoreauSenior .Net ConsultantCommented:
0
 
billy21Author Commented:
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"
0
 
rdrunnerCommented:
Oops...

true :)

But i like the link emoreau posted :) (Its added to my bookmarks now)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now