Thanks,
Pair
"Note: WMI can only enumerate scheduled tasks created with the
Win32_ScheduledJob class or the At.exe utility. It cannot enumerate tasks
created using the Task Scheduler."
(http://www.microsoft.com/technet/scriptcenter/schedule/Scrsch03.asp)
Ray at work
"TwistedPair" <twist...@mail.com> wrote in message
news:u5%23zXwAl...@TK2MSFTNGP10.phx.gbl...
Thanks,
Pair
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:etcAD9Al...@TK2MSFTNGP12.phx.gbl...
Thanks,
Pair
"TwistedPair" <twist...@mail.com> wrote in message
news:eoBgMMBl...@TK2MSFTNGP10.phx.gbl...
function getFolderItems(FolderName)
{
var oShellApp = new ActiveXObject("Shell.Application");
var oFolder = oShellApp.NameSpace(CONTROL_PANEL);
var colItems = oFolder.Items();
var enumItems = new Enumerator(colItems);
for (;!enumItems.atEnd();enumItems.moveNext())
{
var oItem = enumItems.item();
if (oItem.Name == FolderName) break;
}
if (oItem.IsFolder)
{
oFolder = oItem.GetFolder;
return oFolder.Items();
}
return null;
}
function main()
{
var colTasks = getFolderItems("Scheduled Tasks");
}
main();
--
Joe
Scheduled Tasks are stored actually as *.job files in the C:\WINNT\Tasks
folder (whose contents are displayed in Windows Explorer via a shell
extension). The *.job file format in binary, so you need to use the
published COM interfaces to access a task (i.e. a *.job file).
SDK Documentation
Task Scheduler (Task Scheduler: Platform SDK)
http://msdn.microsoft.com/library/en-us/taskschd/taskschd/task_scheduler_start_page.asp
These COM interfaces aren't accessible directly from script. You'll need to
write a COM component capable of using them (the SDK examples are all C++)
or use a public domain component. One such public domain component is
available at:
WSH Scripting [Mark Pryor]
http://mysite.verizon.net/res1ur2j/
Click on "Script Mstask" in the toc...
--
Michael Harris
Microsoft.MVP.Scripting
Windows 2000 Scripting Guide
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp
TechNet Script Center Sample Scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942
WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en