Member Avatar for kohkohkoh

Hello,

Can i know if it is possible to show/ display windows task scheduler information such as:

1) process status -> if it is running or stopped
2) time the scheduler starts
and other related info... on vb

i've beeeen searching for the sources on yahoo and google... yet still no results...

::all i want is to read the information from the scheduler on vb


thank you.

Depends! Are you talking about Scheduled Tasks (clicking start, going to programs, accessories, system tools, Scheduled Tasks) or something like the AT tool, that uses the WMI Class?

Member Avatar for kohkohkoh

Depends! Are you talking about Scheduled Tasks (clicking start, going to programs, accessories, system tools, Scheduled Tasks) or something like the AT tool, that uses the WMI Class?

sorry, i didnt explain clearly
i want to use vb to get the scheduler information and display them on asp page. is it possible??

Yes, but that still doesn't answer my question. There are 2 different ways to add tasks in XP..... 1 is by clicking start, going to programs, accessories, system tools, and clicking scheduled Tasks..... that requires a different means than if you used some other program, or if the WMI class was used......
so which is it?

Member Avatar for kohkohkoh

Yes, but that still doesn't answer my question. There are 2 different ways to add tasks in XP..... 1 is by clicking start, going to programs, accessories, system tools, and clicking task scheduler..... that requires a different means than if you used some other program, or if the WMI class was used......
so which is it?

ops...sorry.
wmi class

List Processes

strComputer = "."
Set objWMIService = GetObject("winmgmts:"     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colScheduledJobs = objWMIService.ExecQuery     ("Select * from Win32_ScheduledJob")

For Each objJob in colScheduledJobs
    Wscript.Echo "Caption: " & objJob.Caption
    Wscript.Echo "Command: " & objJob.Command
    Wscript.Echo "Days of Month: " & objJob.DaysOfMonth
    Wscript.Echo "Days of Week: " & objJob.DaysOfWeek
    Wscript.Echo "Description: " & objJob.Description
    Wscript.Echo "Elapsed Time: " & objJob.ElapsedTime
    Wscript.Echo "Install Date: " & objJob.InstallDate
    Wscript.Echo "Interact with Desktop: " & objJob.InteractWithDesktop
    Wscript.Echo "Job ID: " & objJob.JobID
    Wscript.Echo "Job Status: " & objJob.JobStatus
    Wscript.Echo "Name: " & objJob.Name
    Wscript.Echo "Notify: " & objJob.Notify
    Wscript.Echo "Owner: " & objJob.Owner
    Wscript.Echo "Priority: " & objJob.Priority
    Wscript.Echo "Run Repeatedly: " & objJob.RunRepeatedly
    Wscript.Echo "Start Time: " & objJob.StartTime
    Wscript.Echo "Status: " & objJob.Status
    Wscript.Echo "Time Submitted: " & objJob.TimeSubmitted
    Wscript.Echo "Until Time: " & objJob.UntilTime
Next

Enumerate List (Same As Above): http://www.cruto.com/resources/vbscript/vbscript-examples/os/tasks/List-Scheduled-Tasks.asp
Create: http://www.cruto.com/resources/vbscript/vbscript-examples/os/tasks/Create-a-Scheduled-Task.asp
Delete: http://www.cruto.com/resources/vbscript/vbscript-examples/os/tasks/Delete-a-Scheduled-Task.asp
Delete All: http://www.cruto.com/resources/vbscript/vbscript-examples/os/tasks/Delete-All-Scheduled-Tasks.asp

Member Avatar for kohkohkoh

Sorry for the late reply (busy nowadays)

i've been looking through the codes, i find that there is a problem for this coding, where :

need to use the program to create the task scheduler, then the program can read the information. (get what i mean?)

but if i already created the task in my computer and i use this program to read....it failed to do so...

However, i've researched some on this topic, but not sure if it is working.
B4 I used kernel.dll to read and to do something funny on my pc, How if i use the scheduler dll to read the information as well?
Will it works?

thank you

Hmn, it should....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.