Announcement

Collapse
No announcement yet.

How set this Task Scheduler Actions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How set this Task Scheduler Actions

    Code:
    if not TaskScheduler.DoesJobExist("Mytask") then
      -- schedule a silent update check at logon for my application
      -- the updater is best set to "silent until update is available"
    TaskScheduler.CreateJob("System", "(ignored)", "ONLOGON", 0, "Mytask", SessionVar.Expand("%ApplicationDataFolderCommon%\\TrueUpdateClient.exe"), "/sc monthly /d 1 /ru "System"");
      error = Application.GetLastError();
      if (error ~= 0) then
        Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
      else
        Dialog.Message("Info", "Task was created.", MB_OK, MB_ICONINFORMATION);
      end
    end
    it does not run when system logs on who can fix this please

  • #2
    Originally posted by arodney View Post
    it does not run when system logs on who can fix this please
    Your sample code has an extra quote in the parameters of TaskScheduler.CreateJob(), this would cause a syntax error. Also, it appears that you didn't quite understand that the last parameter is for the scheduled program - these parameters aren't standard arguments for a TrueUpdate client, but look like they are for schtasks.

    You may want to open the Windows Task Manager itself, and verify that the task was created, and is possibly running in the background. If the task is running under a different user account, its GUI won't show on the desktop of the logged user. If you intend to use this with TrueUpdate, then the update check and procedure must be scripted to happen silently and without needing/requesting user interaction.

    Ulrich

    Comment


    • #3
      okay thank you

      Comment

      Working...
      X