A Scheduled Task Does Not Run When You Use Schtasks to Create It and When the start time is a string.

Unanswered A Scheduled Task Does Not Run When You Use Schtasks to Create It and When the start time is a string.

  • Saturday, September 22, 2012 6:53 PM
     
     


    using Visual Studio 2008
    A Scheduled Task Does Not Run When You Use Schtasks to Create It and When the start time is a string.
    For example this will schedule a task.
    System.Diagnostics.Process.Start("schtasks", "/create /SC ONCE /ru System /st 14:13:12 /tn Notepad /tr C:\WINDOWS\system32\Notepad.exe")

    But this will not schedule a task.
    Dim foo as string
    foo = "14:13:12"
    System.Diagnostics.Process.Start("schtasks", "/create /SC ONCE /ru System /st foo /tn Notepad /tr C:\WINDOWS\system32\Notepad.exe")

All Replies

  • Sunday, September 23, 2012 8:32 PM
    Moderator
     
     
    • Marked As Answer by rekcahrb Friday, September 28, 2012 6:19 PM
    • Unmarked As Answer by rekcahrb Monday, October 22, 2012 4:38 PM
    •  
  • Wednesday, September 26, 2012 2:18 PM
     
     

    The problem that I am having is with getting it to schedule the task in the first place, not with a scheduled task not working.

    Please try scheduling a task using a string as the /st .