' ' Author: tlviewer@yahoo.com ' script: ParseMsTaskJob.vbs ' Description: written for Win2k ' keywords: environ tasks mstask enum ' Date: 06/09/04 ' set WSHShell = createobject("WScript.Shell") set oFSO = createobject("Scripting.FileSystemObject") set env = WSHShell.Environment("SYSTEM") TS = WSHSHell.ExpandEnvironmentStrings(env.item("WINDIR")) & "\tasks" wscript.echo TS ' set your JOB name here '''''''''''''''''''''''''''' JobName = TS & "\KickAgent_giga.job" MyJob = GetFile( JobName) 'wscript.echo ascb(midb(MyJunk, 71, 1)) wscript.echo lenb(MyJob) ' our data starts at offset 70 (+1) offset = 71 slen = 0 MyData = Array( "EXE=", "MyParams=", "WorkingDir=", "Creator=", "Comment=") for each zz in MyData wscript.echo zz & GetThis() next wscript.quit(0) ''''''''''' ' helper functions '''''''''''''''' function GetThis() offset = offset + 2 * slen slen = ascb(midb(MyJob, offset, 1)) offset = offset + 2 if slen > 0 then GetThis = midb(MyJob, offset, (2 * slen)-2) else GetThis = "UNDEF" end if end function ' open it as unicode (tristate = -1) function GetFile( sName ) ' as string GetFile = oFSO.opentextfile( sName, 1,false, -1).ReadAll() end function