Ghost Solution Suite

 View Only
Expand all | Collapse all

How do Ghost scheduled tasks relate to Windows Scheduled Tasks?

  • 1.  How do Ghost scheduled tasks relate to Windows Scheduled Tasks?

    Posted May 01, 2007 03:23 PM

    When Ghost schedules a task, it creates a Scheduled Task in Windows named "Symantec Ghost Task - $TASKNAME #NN". In that task object, the run command is:

    "C:\Program Files\Symantec\Ghost\ngcons.exe" /schedule

    How does ngcons.exe use the seemingly non-specific "/schedule" flag to determine which image task it is intended to run? Does the #NN number in the task name relate to an entry in the ghost configuration database?

    My goal is to write a VB script using WMI to add or modify tasks.  I have everything worked out except for how ngcons.exe "knows what to do" based on what is listed in the windows task. 

    I am taking client images in a complex environment, and it is impractical to manually schedule tasks from within the Ghost Console.  Also, a number of the clients are Windows 2000, and do not support Schtasks.exe, which is how I might otherwise programmatically reschedule existing tasks. Any advice, alternate methods, or pointers on which FM to R are appreciated.     Kind Regards, Andy



  • 2.  RE: How do Ghost scheduled tasks relate to Windows Scheduled Tasks?

    Posted May 01, 2007 11:11 PM
    The "#nn" part describes a database ID entry that the console allocates for the scheduled item; that string is descriptive only, the same number is also stored as a DWORD in the task specification using the SetWorkItemData method of the task scheduler's ITask COM interface, and

    In the console's database, this ID links to the "Schedule" table, which then has a "TaskID" column that links to the internal definition of the task.

    When the console executable is run with the "/schedule" flag, it runs through all the Windows task scheduler's objects looking for the ones related to it that the scheduler is running to find the ITask instance that represents the particular instance of the task, and then it uses GetWorkItemData to get back out the right database ID.