Announcement

Collapse
No announcement yet.

Bat File runs fine manually, but not as a scheduled task

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

  • Bat File runs fine manually, but not as a scheduled task

    I'm running 2008 server r2. I'm trying to use a simple bat file

    --- Start of bat file ---
    @ECHO OFF
    REM --------------------------------------------------
    REM *** Tiago Nunes 11/05/2010 ***
    REM --------------------------------------------------
    CLS
    Color 1f
    ECHO -------------------------------------------------
    ECHO *** Inicio do processo EDI ***
    ECHO -------------------------------------------------
    ECHO -------------------------------------------------
    ECHO *** Envio e Recepcao de Ficheiros da mailbox ***
    ECHO -------------------------------------------------
    START "" D:\Influe\Netixone\NetIXOne /cnx
    dir > debug.txt
    ECHO -------------------------------------------------
    ECHO *** Fim do processo EDI ***
    ECHO -------------------------------------------------
    --- End of bat file ---

    Basically the bat file is composed with "START "" D:\Influe\Netixone\NetIXOne /cnx" witch does not execute when invoked by the task scheduler. Nonetheless if executed through the command prompt it works perfectly.

    The “dir > debug.txt” line is for debugging and prove that the task scheduler is executing the bat file (the debug.txt is created).

    Any ideas how to overcome this issue?

    Thank You in Advance

  • #2
    Re: Bat File runs fine manually, but not as a scheduled task

    Originally posted by renovatio View Post
    I'm running 2008 server r2. I'm trying to use a simple bat file

    --- Start of bat file ---
    @ECHO OFF
    REM --------------------------------------------------
    REM *** Tiago Nunes 11/05/2010 ***
    REM --------------------------------------------------
    CLS
    Color 1f
    ECHO -------------------------------------------------
    ECHO *** Inicio do processo EDI ***
    ECHO -------------------------------------------------
    ECHO -------------------------------------------------
    ECHO *** Envio e Recepcao de Ficheiros da mailbox ***
    ECHO -------------------------------------------------
    START "" D:\Influe\Netixone\NetIXOne /cnx
    dir > debug.txt
    ECHO -------------------------------------------------
    ECHO *** Fim do processo EDI ***
    ECHO -------------------------------------------------
    --- End of bat file ---

    Basically the bat file is composed with "START "" D:\Influe\Netixone\NetIXOne /cnx" witch does not execute when invoked by the task scheduler. Nonetheless if executed through the command prompt it works perfectly.

    The “dir > debug.txt” line is for debugging and prove that the task scheduler is executing the bat file (the debug.txt is created).

    Any ideas how to overcome this issue?

    Thank You in Advance
    What happens if you just run the batch file?

    Also is it meant to run in the background?

    What credentials are you using to run the task?

    Comment


    • #3
      Re: Bat File runs fine manually, but not as a scheduled task

      Can you right-click the task in the Scheduler and "Run" it that way?

      If you've got it scheduled to run after hours, make sure the option is selected that tells the computer to wake up to run the task; it'll be under the "Conditions" tab on the task's property sheet.

      Comment


      • #4
        Re: Bat File runs fine manually, but not as a scheduled task

        Hi,

        The task is meant to run on background every 30 minutes.

        If I double click on the batch file (“Comunica.bat”) or run it from the Windows <Run> window the commands in the batch file are well executed.

        If I right-click the task in the Scheduler and "Run" from context menu, this Is what happens :
        START "" D:\Influe\Netixone\NetIXOne /cnx # Not executeddir > debug.txt # Executed, debug.txt created
        See attach files

        Screenshot history
        Screenshot for General tab
        Task is executed with the user GVSRV07\sagex3 that belongs to administrator group
        Screenshot for the action tab
        Attached Files

        Comment


        • #5
          Re: Bat File runs fine manually, but not as a scheduled task

          The scheduled task looks fine to me.

          What is "D:\Influe\Netixone\NetIXOne"?
          Is it an executable? Can you make sure you put the full path into the script i.e.
          Code:
          START "" D:\Influe\Netixone\NetIXOne.exe /cnx
          Regards,
          Jeremy

          Network Consultant/Engineer
          Baltimore - Washington area and beyond
          www.gma-cpa.com

          Comment


          • #6
            Re: Bat File runs fine manually, but not as a scheduled task

            The NetIXOne (NetIXOne .exe) is an executable which syncs EDI messages through a portal. I'm guessing that the "/cnx" is some kind of connection arg.

            I've tested your suggestion
            Code:
            START "" D:\Influe\Netixone\NetIXOne.exe /cnx
            but the program still still won't run.

            Comment


            • #7
              Re: Bat File runs fine manually, but not as a scheduled task

              Try giving the window a title. Change:

              Start ""

              to

              Start "title"

              and see how it works. Apparently, Task Scheduler has problems if the window title is not defined.

              Also, try variations on the Start command - or, you could try removing it altogether...
              A recent poll suggests that 6 out of 7 dwarfs are not happy

              Comment

              Working...
              X