home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sysmgmt / tasksched / readme.txt < prev    next >
Text File  |  1997-05-28  |  4KB  |  95 lines

  1. Overview:
  2.     SA.EXE is sample code that demonstrates the new scheduling agent API
  3. provided with installation of the Scheduling Agent package;  complete
  4. documentation describing the interfaces is available elsewhere in the 
  5. ActiveX SDK.  The sample mimics the functionality of the AT command 
  6. through the Scheduling Agent APIs, as opposed to the NetSchedule API 
  7. used by AT.  This sample implements only a small subset of the AT 
  8. command set, but should be easily extensible.
  9.  
  10. Usage:
  11.         sa                                                - Show All Tasks
  12.         sa /?                                             - Display Help
  13.         sa JobName.job /DELETE                            - delete job
  14.         sa JobName.job Time Command [UserName [Password]] - submit a job
  15.  
  16. Job Time is in 24 hour format (such as 15:30) and is the next instance 
  17. of this specific time within 24 hours.
  18.  
  19. Command is the name of the application to run.  Path names may be included.
  20. However, spaces are not allowed in the path name, so an application residing
  21. in C:\program files\foo.exe should be specified as C:\progra~1\foo.exe,
  22. using the old-style 8.3 filenames.  Should any command line parameters
  23. be required, enclose the entire Command string in quotes:
  24.     "c:\progra~1\foo.exe /bar 5"
  25.  
  26. Username and password are required to run the specified task under Windows NT.
  27. Under Windows NT, if they are not specified as part of the command line, 
  28. a prompt for the missing data will be displayed.  Under Windows 95, 
  29. both fields are ignored, if specified.  Regardless of specification,
  30. under Windows 95, no prompt will be displayed.
  31.  
  32. Error Reporting:
  33.     The program performs error checking within the code over the parameters
  34. passed in.  Any errors are returned as the exit value of "main", which may
  35. be read by checking the environmental value %ERRORLEVEL% under Windows NT,
  36. or the corresponding variable in Windows 95.   
  37.  
  38. Additional Notes:
  39.     The program makes use of the following interfaces and methods:
  40.     
  41.     1. ISchedulingAgent::Enum
  42.        ISchedulingAgent::Activate
  43.        ISchedulingAgent::Delete
  44.        ISchedulingAgent::NewTask
  45.  
  46.     2. IEnumTasks::Next
  47.  
  48.     3. ITask::GetTriggerCount
  49.        ITask::GetTriggerString
  50.        ITask::SetAccountInformation
  51.        ITask::SetApplicationName
  52.        ITask::SetParameters
  53.        ITask::SetComment
  54.        ITask::SetFlags
  55.        ITask::CreateTrigger
  56.  
  57.     4. ITaskTrigger::SetTrigger
  58.  
  59.     In addition, various methods on IUnknown and IPersistFile are called.
  60. It is assumed that a user of this code has familiarity with those 
  61. interfaces and calling conventions.  
  62.  
  63.     The output of the program is one of four possibilities:
  64.  
  65.     First, and most obviously, is the presentation of a help file.  This
  66. case occurs from command line arguments requesting help, or from input
  67. parameter lists that are longer than the expected range. Output is to
  68. stdout.
  69.  
  70.     Second, the program can enumerate all task objects in the tasks folder.
  71. Output is provided to stdout, and consists of a line containing
  72. "Job: filename.job" followed by indented lines containing strings of the
  73. type "Trigger: text representation of trigger values".  Empty task folders
  74. cause no output.
  75.  
  76.     Third, the program can delete jobs from the job folder.  This action
  77. will fail in a secure environment (Windows NT on an NTFS partition) if
  78. the caller does not have permissions to remove the file.  Deletion
  79. of tasks is not limited to those that were created from this program.
  80. If the deletion succeeds, no output is displayed.
  81.  
  82.     Finally, the program can add a task from the command line.  If the
  83. scheduling agent is to recognize the task, the filename (jobname.job) 
  84. given MUST have the extension ".job" on it.  Otherwise, it will fail
  85. to be enumerated from this tool, the task scheduler, or anywhere else.
  86. In addition, that task will fail to run if ".job" is not the file
  87. extension.  If the addition succeeds, no output is displayed.
  88.  
  89.     The task type that is created has a single trigger of type "ONCE"
  90. and is limited to running within the next 24 hours.  Also, like AT,
  91. these jobs will be deleted upon completion of their run.  For
  92. creation of other types of triggers, please consult the documentation
  93. for the TASK_TRIGGER structure.
  94.  
  95.