473,320 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Creating scheduled job programmatically

RJN
Hi

I want to create a scheduled job through code. In VB we would do this
using the Win32 API class "Win32_ScheduledJob"

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create _
("Notepad.exe", "********012500.000000-420", _
True , 4, , True, JobId)
Does .Net provide any classes for doing this?

Regards

RJN
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 1840
Look into System.Management namespace. That should provide most of the
classes you are looking for.

--
Girish Bharadwaj
http://msmvps.com/gbvb
"RJN" <rj*@yahoo.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi

I want to create a scheduled job through code. In VB we would do this
using the Win32 API class "Win32_ScheduledJob"

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create _
("Notepad.exe", "********012500.000000-420", _
True , 4, , True, JobId)
Does .Net provide any classes for doing this?

Regards

RJN
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: John Bowman | last post by:
Hi, I have a C# app that needs to launch the "Add Scheduled Tasks" wizard found in the control panel "Scheduled Tasks" applet. I realize that this "applet" really just opens the tasks folder,...
3
by: Lenn | last post by:
Hi, I developed a console .exe application which is going to run on scheduled basis, it will be scheduled to run in Windows Scheduled tasks. Client wants some kind of utility that would help them...
1
by: Keith Harris | last post by:
Hi, I have an ASP.NET web application that runs certain tasks at a given time. Sometimes the task is scheduled to run at a time that coincides with when IIS is recycling an application's...
5
by: Brian McClellan | last post by:
Just wondering if anyone has a simple example of creating a gridview completely programmatically, i'm not doing anything terribly sophisticated. When creating the gridview declaratively evertying...
2
by: Eric | last post by:
Is there a way for my .Net application to lauch the Windows Scheduled Task Wizard? I know there are the ITask APIs to create tasks directly. But is there a way for my application to launch the...
4
by: Neil | last post by:
Hi, I am having problems in trying to create a scheduled task from within in application that carries out a health check on a client. I am using VS 2005. When the program runs it flashes a...
0
by: Paulson | last post by:
Dear Freinds I want to make a program that acts as a reminder for the users.I need to open up the Scheduled task wizard programmatically.If you type Tasks in the run command the Tasks...
9
by: jdaelhousen | last post by:
I have a bit of a problem I'm hoping someone can shed some light on... I have a VB.Net console application written in VS 2003 that produces a .exe file that now sits on a Windows 2000 server...
0
by: foltac | last post by:
We run a database replication process that ultimately puts a new copy of an Access DB in a new folder (on the server harddisk) every night. The folder is programmatically named and includes the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.