Scheduled task not running on Windows Server 2008 but working on Windows XP


  • Hi,

    I have created a console application using .NET 3.5 framework for fetching data from the oracle database and sending it as an attachment via email.

    Using the task scheduler I have scheduled a task to run the console application's .exe file at 9 AM every day.

    The task is scheduled properly and works fine on a Windows XP machine and doesn't work on windows 2008 server.

    When the task is run for the first time on XP and installation prompt is displayed. Once the installation is done from the next time onwards the task is getting executed as scheduled without any issues.

    In case of windows server 2008, I did not get any installation prompt, so I went ahead and double clicked the .exe file to install it on the server and scheduled it. I am getting a 'success' message every time it executes, but the data is not being sent as a mail which means the .exe program is not executed. I have used domain credentials as well as the machine's administrator credentials to verify this.

    I have also checked the firewall settings and there is no issue with it as it is turned off.

    I have checked the logs in event viewer, but no error messages have been logged.

    Please let me know if there is a solution to this issue.

    Thank you.



    Badarinath Pennati.

    miércoles, 08 de septiembre de 2010 9:15

Todas las respuestas

  • Take a look at the following KB.

    MCITP: Enterprise Messaging Administrator 2007/2010 | MCITP: Server Administrator | MCTS: Windows Server 2008 Applications Infrastructure, Configuring | MCP | MCDST
    miércoles, 08 de septiembre de 2010 15:00
  • Hi Tom,

    Thanks for the reply. The KB suggested by you does not contain the solution for my issue. I have tried creating the task from command prompt. The task gets scheduled properly when created from the command prompt or through user interface.

    But when the task is run I am still getting the message as "The operation completed successfully. (0x0)" without the task getting executed completely. I have placed a log statement at the start of the program, and no information is logged which means the program is not invoked by the scheduler. This issue occurs only in Windows Server 2008.

    Since I am not using the command prompt for executing the service, I don't think the hot fix suggested in the above KB holds good.


    jueves, 09 de septiembre de 2010 0:09
  • On the properties of the task that was created in the Task Scheduler, what do you have selected in the Configure for section. Is it the option Windows Vista, Windows Server 2008?

    Also, under the Security Options of the task in the General tab, can you choose the following option Run with highest Privileges then confirm if it exectues successfully.

    If it is still failing after trying the above, then as a test can you try the following adding the scheduled task in the Startup folder (C:\Users\<admin_acct>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup) and see if it exectues successfully.



    MCITP: Enterprise Messaging Administrator 2007/2010 | MCITP: Server Administrator | MCTS: Windows Server 2008 Applications Infrastructure, Configuring | MCP | MCDST
    jueves, 09 de septiembre de 2010 2:14
  • Hi Tom,

    Thanks again!

    In the configure section I have selected 'Windows Vista, Windows Server 2008' option.

    Currently I am using the 'run with highest privileges' option in my task because of which I am getting 'The operation completed successfully' message, else I used to get an error log in event viewer even when the task is executed successfully.

    Following is the log data:

    Log Name:      System
    Source:        Microsoft-Windows-DistributedCOM
    Date:          9/1/2010 9:00:02 AM
    Event ID:      10016
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          DMNNAME\UsrName
    The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID
     to the user DMNNAME\UsrName SID (S-1-5-21-1535773150-520773558-1539857752-506717) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.
    Event Xml:
    <Event xmlns="">
        <Provider Name="Microsoft-Windows-DistributedCOM" Guid="{1B562E86-B7AA-4131-BADC-B6F3A001407E}" EventSourceName="DCOM" />
        <EventID Qualifiers="49152">10016</EventID>
        <TimeCreated SystemTime="2010-09-01T13:00:02.000Z" />
        <Correlation />
        <Execution ProcessID="0" ThreadID="0" />
        <Security UserID="S-1-5-21-1535773150-520773558-1539857752-506717" />
        <Data Name="param1">machine-default</Data>
        <Data Name="param2">Local</Data>
        <Data Name="param3">Activation</Data>
        <Data Name="param4">{33246F92-D56F-4E34-837A-9A49BFC91DF3}</Data>
        <Data Name="param5">DMNNAME</Data>
        <Data Name="param6">UsrName</Data>
        <Data Name="param7">S-1-5-21-1535773150-520773558-1539857752-506717</Data>
        <Data Name="param8">LocalHost (Using LRPC)</Data>

    If I am selecting the 'run with highest privileges' option I am not getting any information logged to the System log.

    Even executing the program from the startup of an admin user did not help.

    Please note that the application I want to schedule is an .exe file obtained from a .NET 3.5 console application. All the supporting files like config and manifest files are present along with the executable.

    jueves, 09 de septiembre de 2010 3:35
  • Hi Tom,

    Another observation made. When I double click the .exe file on XP the application is executing and sending an email. But if I do the same on Windows Server 2008, the application is not getting executed.

    So, the issue is not with the Task Scheduler. Probably it should be with Server or Network settings.

    My UserID has admin access on the Server machine. And I have also used the actual system's administrator credentials to check  this issue. In both the cases I am unable to execute the application.

    jueves, 09 de septiembre de 2010 3:49
  • Have the same problem.

    Have an exe file that is scheduled on the Server 2008 R2. The scheduler starts the process, however, program is not executed. I have no problem scheduling this program in Win XP. Yet, on Server 2008 it looks like a process is created by task scheduler but the program is not executed.

    Would appreciate a help. Tried everything recommended above - does not help
    lunes, 25 de octubre de 2010 16:18
  • I know its being long time but I had the same problem today, Once i have changed Option to   Run only when usrer is logged on , it worked
    • Propuesto como respuesta esteban2800 domingo, 20 de mayo de 2012 16:54
    lunes, 28 de marzo de 2011 9:18
  • I have the same problem. I can run a program via Command Line and via .bat file, however, when i schedule this process, the scheduler reports that it has run correctly and without errors, however, the program is not being run. I have tried privilege changes, different variations on writing the task commends etc. but nothing is working - really need some help on this as it is doing my head in !!
    viernes, 15 de abril de 2011 16:53
  • I'm also able to run my executable when I select Run only when usrer is logged on, but I can't stay logged in with the account. Has anyone found a solution?
    Imperfect IT - Because when does anything work the way it's supposed to?
    miércoles, 04 de mayo de 2011 21:29
  • I had this exact same issue and was able to fix it on my end.  My problem was that Server 2008's Task Scheduler defaults to a system directory as the "Start In" path if you don't set one.  So even though my task's action was to run D:\websites\site\bin\MyApp.exe, the exe was being run as if it were in the system directory, preventing it from finding the web.config file it needed to reference.  By setting the Start In path manually (under the Action properties) to D:\websites\site\bin, the task started working perfectly.
    • Propuesto como respuesta Prashant Channe martes, 28 de junio de 2011 11:18
    viernes, 20 de mayo de 2011 19:45
  • Hi Danny

    The solution worked for me.


    Prashant Channe

    martes, 28 de junio de 2011 11:18
  • Thank you kindly, DannyBGood.

    Changing the "Start In" path did correct this issue for me. :)

    martes, 20 de septiembre de 2011 0:14
  • Thanks Danny, It`s worked for me
    • Editado Sdeepsingh jueves, 22 de septiembre de 2011 5:47
    jueves, 22 de septiembre de 2011 5:46
  • Many thanks! Helped us too.

    lunes, 16 de enero de 2012 11:27
  • Thanks Danny,

    Your solution works form me also.


    Fabrizio FDL

    jueves, 31 de mayo de 2012 13:04
  • The solution worked for me.


    James Ward

    miércoles, 08 de agosto de 2012 16:49
  • This was the answer for me too.  Initially it did not work, but after moving the executable to a path that did not contain spaces and then entering the path info in the start in directory = voila, success!  Using quotes around the path which contained spaces resulted in an invalid directory error in the event viewer.  Thanks for sharing this info.

    viernes, 07 de septiembre de 2012 16:32
  • Thanks Danny,

    This worked for me as well.

    jueves, 04 de octubre de 2012 14:59
  • Thanks!  Just spent half a day figuring this one out.
    jueves, 15 de noviembre de 2012 20:23
  • Thanks. Once I set the "Start In" it worked like a charm. My path also had spaces and (), still it worked.
    miércoles, 28 de noviembre de 2012 18:53
  • Thank you kindly, DannyBGood.

    Changing the "Start In" path did correct this issue for me. :)

    "Start In" also works for me.Thank you all.
    sábado, 22 de diciembre de 2012 7:26
  • thanks for the tips, it did solve my problem as well.
    lunes, 22 de julio de 2013 13:57
  • Tks, Its Worked for me too!
    jueves, 10 de octubre de 2013 14:00
  • Awesome, that did it for me!

    miércoles, 11 de diciembre de 2013 13:45
  • Changing the start in property worked perfectly! Thank You! 
    jueves, 12 de junio de 2014 18:22
  • This helps. After defining the Start In Path, which though is optional, I am able to run the scheduled tasks successfully. Thanks a lot.
    martes, 12 de agosto de 2014 2:59