Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , ,

Sponsored Links



VBScript for WMI listing of scheduled tasks?

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 11-09-2008
Jason
 
Posts: n/a
VBScript for WMI listing of scheduled tasks?

I'm trying to list the scheduled tasks on a Win Server 2008 64-bit machine.
But running the following script produces no results (or errors):

strComputer = "."

set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colScheduledJobs = objWMI.ExecQuery("Select * from Win32_ScheduledJob")
for each objJob in colScheduledJobs
MsgBox objJob.Name
next
Reply With Quote
  #2  
Old 11-09-2008
Masterplan
 
Posts: n/a
RE: VBScript for WMI listing of scheduled tasks?

Hi Jason,

The Win32_ScheduledJob WMI class represents a job created with the AT
command. The Win32_ScheduledJob class does not represent a job created with
the Scheduled Task Wizard from the Control Panel. That's why it produce no
results.

--
Have a nice day!

http://winmasterplan.blogspot.com


"Jason" wrote:

> I'm trying to list the scheduled tasks on a Win Server 2008 64-bit machine.
> But running the following script produces no results (or errors):
>
> strComputer = "."
>
> set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> set colScheduledJobs = objWMI.ExecQuery("Select * from Win32_ScheduledJob")
> for each objJob in colScheduledJobs
> MsgBox objJob.Name
> next

Reply With Quote
  #3  
Old 11-09-2008
Jason
 
Posts: n/a
RE: VBScript for WMI listing of scheduled tasks?

Thank you.

And is there a WMI class (or other script-accessible class) with which I can
list the jobs created via the Scheduled Task interface?

"Masterplan" wrote:

> Hi Jason,
>
> The Win32_ScheduledJob WMI class represents a job created with the AT
> command. The Win32_ScheduledJob class does not represent a job created with
> the Scheduled Task Wizard from the Control Panel. That's why it produce no
> results.
>
> --
> Have a nice day!
>
> http://winmasterplan.blogspot.com
>
>
> "Jason" wrote:
>
> > I'm trying to list the scheduled tasks on a Win Server 2008 64-bit machine.
> > But running the following script produces no results (or errors):
> >
> > strComputer = "."
> >
> > set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> > set colScheduledJobs = objWMI.ExecQuery("Select * from Win32_ScheduledJob")
> > for each objJob in colScheduledJobs
> > MsgBox objJob.Name
> > next

Reply With Quote
  #4  
Old 11-09-2008
Masterplan
 
Posts: n/a
RE: VBScript for WMI listing of scheduled tasks?

Hi again,

I didn't find such a specific class. I used a time ago schtasks /query to do
this.

--
Have a nice day!

http://winmasterplan.blogspot.com


"Jason" wrote:

> Thank you.
>
> And is there a WMI class (or other script-accessible class) with which I can
> list the jobs created via the Scheduled Task interface?
>
> "Masterplan" wrote:
>
> > Hi Jason,
> >
> > The Win32_ScheduledJob WMI class represents a job created with the AT
> > command. The Win32_ScheduledJob class does not represent a job created with
> > the Scheduled Task Wizard from the Control Panel. That's why it produce no
> > results.
> >
> > --
> > Have a nice day!
> >
> > http://winmasterplan.blogspot.com
> >
> >
> > "Jason" wrote:
> >
> > > I'm trying to list the scheduled tasks on a Win Server 2008 64-bit machine.
> > > But running the following script produces no results (or errors):
> > >
> > > strComputer = "."
> > >
> > > set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> > > set colScheduledJobs = objWMI.ExecQuery("Select * from Win32_ScheduledJob")
> > > for each objJob in colScheduledJobs
> > > MsgBox objJob.Name
> > > next

Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "VBScript for WMI listing of scheduled tasks?"
Thread Thread Starter Forum Replies Last Post
Windows Scheduled Tasks don't luanch if tasks not finished Andy Candy Windows Software 3 21-08-2009 12:47 PM
Scheduled Tasks: Notify me of missed tasks Swifty Windows XP Support 2 02-01-2009 02:45 PM
Scheduled Tasks Starfish Small Business Server 2 07-10-2008 04:50 PM
Scheduled Tasks requeth@gmail.com Windows Server Help 2 22-01-2008 11:38 PM
Where are kept Scheduled tasks? Jack Vista Help 8 18-01-2008 01:28 AM


All times are GMT +5.5. The time now is 09:24 PM.