I found on the MS Script Center the following script:
http://www.microsoft.com/technet/scriptcenter/scripts/os/tasks/ostkvb04.mspx
But as the description Say :
Enumerates all the scheduled tasks on a computer. Note: WMI can only
enumerate scheduled tasks created using the Win32_ScheduledJob class
or the At.exe utility. It cannot enumerate tasks created using the
Task Scheduler.
Anybody know a solution to list task create in the Task Scheduler ?
THX
Hi
'--------------------8<----------------------
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
Set oShellApp = CreateObject("Shell.Application")
Set oTasksFolder = oShellApp.Namespace(sWinDir & "\Tasks")
For Each oTaskItem In oTasksFolder.Items
sTaskName = oTaskItem.Name
If sTaskName <> "Add Scheduled Task" Then
WScript.Echo sTaskName
End If
Next
'--------------------8<----------------------
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
There is a way to show all other column ? (status, last scheduled,
etc...) I had try to change .name into .statut but of course is not
recognise....
Any idea ?
Hi
You could parse the output from the command line tool SCHTASKS.EXE
on WinXP and Win2k3 Server.
If you are using Windows 2000 SCHTASKS.EXE won't be there, but you
can use JT.EXE that is available here:
ftp://ftp.microsoft.com/ResKit/win2000/
More about JT.EXE here:
http://www.jsiinc.com/subf/tip2600/rh2621.htm
> To parse it, there is way to do it withour rediret the result into a
> temp file to parte it , but directly do it in memory ?
>
Hi
Well, you have the Exec method that was introduced with WSH 5.6 that
provides access to the StdIn/StdOut/StdErr streams, but I always
prefer to redirect to a temp file and then parse it, see an example
on this here:
http://groups.google.co.uk/groups?selm=ea54829eEHA.3632%40TK2MSFTNGP11.phx.gbl
Toomany