creating a scheduled task.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neil

    #1

    creating a scheduled task.

    Hi,
    I am having problems in trying to create a scheduled task from within
    in application that carries out a health check on a client. I am using
    VS 2005.

    When the program runs it flashes a command prompt but does nothing.

    Dim task As New System.Diagnost ics.ProcessStar tInfo("schtasks /create
    /tn ""Test2"" /tr C:\WINDOWS\syst em32\calc.exe /sc daily /st 15:14:00
    /ru ""System""" )
    System.Diagnost ics.Process.Sta rt(task)

    Any help will be gratefully received
    Neil.

  • Jared Parsons [MSFT]

    #2
    Re: creating a scheduled task.

    Hello Neil,
    Hi,
    I am having problems in trying to create a scheduled task from within
    in application that carries out a health check on a client. I am using
    VS 2005.
    When the program runs it flashes a command prompt but does nothing.
    >
    Dim task As New System.Diagnost ics.ProcessStar tInfo("schtasks /create
    /tn ""Test2"" /tr C:\WINDOWS\syst em32\calc.exe /sc daily /st 15:14:00
    /ru ""System""" )
    System.Diagnost ics.Process.Sta rt(task)
    Any help will be gratefully received Neil.
    Is the application running as a non-administrator? If so this won't work
    because you have to be an admin to run schtasks.

    Otherwise what is the return code of schtasks?

    --
    Jared Parsons [MSFT]
    jaredpar@online .microsoft.com
    All opinions are my own. All content is provided "AS IS" with no warranties,
    and confers no rights.


    Comment

    • Neil

      #3
      Re: creating a scheduled task.

      Jared wrote:
      Hello Neil,
      >
      Hi,
      I am having problems in trying to create a scheduled task from within
      in application that carries out a health check on a client. I am using
      VS 2005.
      When the program runs it flashes a command prompt but does nothing.

      Dim task As New System.Diagnost ics.ProcessStar tInfo("schtasks /create
      /tn ""Test2"" /tr C:\WINDOWS\syst em32\calc.exe /sc daily /st 15:14:00
      /ru ""System""" )
      System.Diagnost ics.Process.Sta rt(task)
      Any help will be gratefully received Neil.
      >
      Is the application running as a non-administrator? If so this won't work
      because you have to be an admin to run schtasks.
      >
      Otherwise what is the return code of schtasks?
      >
      --
      Jared Parsons [MSFT]
      jaredpar@online .microsoft.com
      All opinions are my own. All content is provided "AS IS" with no warranties,
      and confers no rights.
      Hi Jared,
      I had the application running as a non-administrator but schtasks
      still does not return an error code.
      thank you for help
      Neil

      Comment

      • Eric Moreau

        #4
        Re: creating a scheduled task.

        See an article I wrote in August 2004 from http://emoreau.s2i.com/. A
        wrapper for the scheduled task is available for download.

        --


        HTH

        Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
        Conseiller Principal / Senior Consultant
        S2i web inc. (www.s2i.com)


        "Neil" <neiltay@gmail. comwrote in message
        news:1152178494 .649138.192680@ b68g2000cwa.goo glegroups.com.. .
        Hi,
        I am having problems in trying to create a scheduled task from within
        in application that carries out a health check on a client. I am using
        VS 2005.
        >
        When the program runs it flashes a command prompt but does nothing.
        >
        Dim task As New System.Diagnost ics.ProcessStar tInfo("schtasks /create
        /tn ""Test2"" /tr C:\WINDOWS\syst em32\calc.exe /sc daily /st 15:14:00
        /ru ""System""" )
        System.Diagnost ics.Process.Sta rt(task)
        >
        Any help will be gratefully received
        Neil.
        >

        Comment

        • Neil

          #5
          Re: creating a scheduled task.

          Hi Éric,
          this is just what I was looking for, thank you very much.
          Neil


          Eric Moreau wrote:
          See an article I wrote in August 2004 from http://emoreau.s2i.com/. A
          wrapper for the scheduled task is available for download.
          >
          --
          >
          >
          HTH
          >
          Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
          Conseiller Principal / Senior Consultant
          S2i web inc. (www.s2i.com)

          >
          "Neil" <neiltay@gmail. comwrote in message
          news:1152178494 .649138.192680@ b68g2000cwa.goo glegroups.com.. .
          Hi,
          I am having problems in trying to create a scheduled task from within
          in application that carries out a health check on a client. I am using
          VS 2005.

          When the program runs it flashes a command prompt but does nothing.

          Dim task As New System.Diagnost ics.ProcessStar tInfo("schtasks /create
          /tn ""Test2"" /tr C:\WINDOWS\syst em32\calc.exe /sc daily /st 15:14:00
          /ru ""System""" )
          System.Diagnost ics.Process.Sta rt(task)

          Any help will be gratefully received
          Neil.

          Comment

          Working...