473,387 Members | 3,787 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,387 software developers and data experts.

Win32_ScheduledJob

When i am trying to list scheduled jobs via Win32_ScheduledJob wmi class i
only get the job that has been created by wmi, not the jobs added through
the control panel scheduled tasks. Is this a know issue or should i use
something else than WMI?
Nov 17 '05 #1
5 11693
Hi Jonas,
When i am trying to list scheduled jobs via Win32_ScheduledJob
only get the job that has been created by wmi, not the jobs added
through the control panel scheduled tasks. Is this a know issue or
should i use something else than WMI?


yes, such behavior is by design. WMI uses different technologies to create
scheduled tasks from the one used by Control Panel|Schudled Tasks program.
As a result, WMI script can only query out the tasks created by WMI code
and AT command. The tasks created manually in Control Panel|Scheduled Tasks
cannot be found by WMI code.

However the Scheduled Task SDK API can query all scheduled task jobs
including those created manually by
Control Panel|Scheduled Tasks. But there is not a .NET framework built-in
support to use these API, you need to write some COM Interop in your .NET
program, it would be somehow complicated.

Please refer to the following MSDN doc for the details and one VB.NET
sample project which wrapped those Scheduled Task API:

The Task Scheduler API
http://msdn.microsoft.com/library/de...us/taskschd/ta
skschd/about_the_task_scheduler.asp

Wrapper Classes for the Windows Task Scheduler
http://www.mvps.org/emorcillo/en/cod...asksched.shtml
Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '05 #2
Hi Jonas,
When i am trying to list scheduled jobs via Win32_ScheduledJob
only get the job that has been created by wmi, not the jobs added
through the control panel scheduled tasks. Is this a know issue or
should i use something else than WMI?


yes, such behavior is by design. WMI uses different technologies to create
scheduled tasks from the one used by Control Panel|Schudled Tasks program.
As a result, WMI script can only query out the tasks created by WMI code
and AT command. The tasks created manually in Control Panel|Scheduled Tasks
cannot be found by WMI code.

However the Scheduled Task SDK API can query all scheduled task jobs
including those created manually by
Control Panel|Scheduled Tasks. But there is not a .NET framework built-in
support to use these API, you need to write some COM Interop in your .NET
program, it would be somehow complicated.

Please refer to the following MSDN doc for the details and one VB.NET
sample project which wrapped those Scheduled Task API:

The Task Scheduler API
http://msdn.microsoft.com/library/de...us/taskschd/ta
skschd/about_the_task_scheduler.asp

Wrapper Classes for the Windows Task Scheduler
http://www.mvps.org/emorcillo/en/cod...asksched.shtml
Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '05 #3
Hi Gary.

Thank you for your fast reply, and for further guidence in this case.

Regards
Jonas
""Gary Chang[MSFT]"" <v-******@online.microsoft.com> wrote in message
news:81**************@TK2MSFTNGXA01.phx.gbl...
Hi Jonas,
When i am trying to list scheduled jobs via Win32_ScheduledJob
only get the job that has been created by wmi, not the jobs added
through the control panel scheduled tasks. Is this a know issue or
should i use something else than WMI?


yes, such behavior is by design. WMI uses different technologies to create
scheduled tasks from the one used by Control Panel|Schudled Tasks program.
As a result, WMI script can only query out the tasks created by WMI code
and AT command. The tasks created manually in Control Panel|Scheduled
Tasks
cannot be found by WMI code.

However the Scheduled Task SDK API can query all scheduled task jobs
including those created manually by
Control Panel|Scheduled Tasks. But there is not a .NET framework built-in
support to use these API, you need to write some COM Interop in your .NET
program, it would be somehow complicated.

Please refer to the following MSDN doc for the details and one VB.NET
sample project which wrapped those Scheduled Task API:

The Task Scheduler API
http://msdn.microsoft.com/library/de...us/taskschd/ta
skschd/about_the_task_scheduler.asp

Wrapper Classes for the Windows Task Scheduler
http://www.mvps.org/emorcillo/en/cod...asksched.shtml
Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 17 '05 #4
Hi Gary.

Thank you for your fast reply, and for further guidence in this case.

Regards
Jonas
""Gary Chang[MSFT]"" <v-******@online.microsoft.com> wrote in message
news:81**************@TK2MSFTNGXA01.phx.gbl...
Hi Jonas,
When i am trying to list scheduled jobs via Win32_ScheduledJob
only get the job that has been created by wmi, not the jobs added
through the control panel scheduled tasks. Is this a know issue or
should i use something else than WMI?


yes, such behavior is by design. WMI uses different technologies to create
scheduled tasks from the one used by Control Panel|Schudled Tasks program.
As a result, WMI script can only query out the tasks created by WMI code
and AT command. The tasks created manually in Control Panel|Scheduled
Tasks
cannot be found by WMI code.

However the Scheduled Task SDK API can query all scheduled task jobs
including those created manually by
Control Panel|Scheduled Tasks. But there is not a .NET framework built-in
support to use these API, you need to write some COM Interop in your .NET
program, it would be somehow complicated.

Please refer to the following MSDN doc for the details and one VB.NET
sample project which wrapped those Scheduled Task API:

The Task Scheduler API
http://msdn.microsoft.com/library/de...us/taskschd/ta
skschd/about_the_task_scheduler.asp

Wrapper Classes for the Windows Task Scheduler
http://www.mvps.org/emorcillo/en/cod...asksched.shtml
Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 17 '05 #5
It's OK, Jonas, you are welcome:)
Good Luck!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '05 #6

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

Similar topics

4
by: Colin Steadman | last post by:
We have a number of scheduled tasks on our IIS server that run daily at some point during the early morning. These tasks run as a specific user that has the correct permissions to perform whatever...
0
by: Jonas | last post by:
When i am trying to list scheduled jobs via Win32_ScheduledJob wmi class i only get the job that has been created by wmi, not the jobs added through the control panel scheduled tasks. Is this a...
1
by: RJN | last post by:
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:" _ &...
3
by: RJN | last post by:
Hi I'm trying to create a windows task through code. I could do this through the shell command and the WMIService in .net exe. But the same doesn't work from asp.net. Any idea? This is the code...
1
by: RJN | last post by:
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:" _ &...
0
by: RJN | last post by:
Hi I'm trying to create a windows task through code. I could do this through the shell command and the WMIService in .net exe. But the same doesn't work when I have this code in a method in .dll...
0
by: kkkanoor | last post by:
I am trying to schedule tasks in Windows from my C# program. The tasks get listed in Windows Schedule Tasks list, but it is not getting invoked. It seems I need to give the user name and password to...
0
by: EricBlair | last post by:
I have this vbs script below that gets copied onto a remote computer by another script. However, this does not run the GUI app interactively, instead what it does is it runs psexec on the task...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.