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

  • Question


  • 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")

    Saturday, September 22, 2012 6:53 PM

All replies

    • Marked as answer by rekcahrb Friday, September 28, 2012 6:19 PM
    • Unmarked as answer by rekcahrb Monday, October 22, 2012 4:38 PM
    Sunday, September 23, 2012 8:32 PM
    Moderator
  • 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 .

    Wednesday, September 26, 2012 2:18 PM