30

I'm just a lowly developer, but a scheduled (2:00 am) VB.Net console app job I inherited is intermittently not running to completion. About half the time, it just doesn't run to completion, logging and event: Task Scheduler successfully completed task "[appname]" , instance "{3f00cbd6-b40e-4e74-a0da-4def71b4d7db}" , action "D:\Scheduled Tasks[foldername][appname.exe]" with return code 3762504530.

I found one other mention of that return code on the web, and the guy included the description of some settings; below are our analagous settings with answers provided by our Networking guy.

I'd be pathetically grateful for any advice or direction... thanks in advance.

Does the job "run whether user is logged in or not"? - YES

Is the job "run with highest privileges" - YES

What's the server OS? - Window 2008 R2 Standard

Is it true that "the only conditions set is to wake computer to run"? It is not set to wake the computer to run the task. However, it is not going to sleep and the task is running. It's just exiting abnormally.

Are the "settings are allow task to be run on demand / stop task if running more than 3 days / if task does not end when requested force it to stop"? YES, it can be run on demand; YES, it will stop the task if it runs longer than 4 hours; YES, it will force it to stop if it doesn't end as requested.

4
  • When I tried running the job using a service account and it gave me the same error. Then I tried using the basic task, which took me through the wizard that let me create the task with the user I was logged with and it ran beautifully. The main problem I had when I was running this executable was an issue with access rights of the user I had previously used. Try running the application from the command line with the user that runs the task. If you are able to run the application with no problems, you should be able to schedule it to run without an issue. It could also show you the error messag
    – user375814
    Sep 14, 2016 at 21:09
  • did you get final solution ? programmatically ?
    – Kiquenet
    Dec 14, 2017 at 22:47
  • Check access rights assigned to that particular folder.
    – Hong
    Jul 17, 2019 at 7:20
  • In my case, I had to set the "Startup Location" to same directory in Task Scheduler.
    – th1rdey3
    Feb 14, 2022 at 10:59

5 Answers 5

35

I believe that return code is a generic .NET console app crashed code. The way the job is set up in Task Scheduler is not causing this issue.

Check the Application event log on the server for any errors that occurred near the time the job 'completed'. Those events should give you more information as to why the job exited abnormally, so you have some idea where to start troubleshooting.

7

If you check the Event Log-->Application, you might get detailed info there. You should be able to find an error record with exception code 0xe0434352 which is the Hex value of 3762504530

1

I had this same return code (3762504530) when trying to use a service account to run a scheduled task for a data import. My issue was the service account couldn't access the log file. I granted an non-inherited permission for just that folder containing the log file to the service account (full control) and it fixed the issue.

0

The .NET answer is definitely right. Just thought I would share my specific example of this error for anyone else that googles this problem.

I had this error message on a Windows Server 2012 scheduled task. We had built a console app using .NET 4.6.1, the default in VS 2017.

Turns out the server only had .NET 4.5.1 installed. Changed the .NET target of the app to match and the task ran no problem. Obviously, updating the server's runtime version could have fixed it as well.

0

I had this same issue with a Task Scheduler job 'successfully completed' with a return code of '3762504530' showing in the Task Scheduler History. The Eventlog for my scheduled task provided the following information

Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException

I tried a few other things, but finally I ran the program from a command line and discovered that some of the 3rd Party DLL's weren't installed on the server.

TROUBLESHOOTING!

  1. Try to run from the command line to reproduce the error
  2. Check the Event Viewer, generally some more details here
  3. Run the command from Task Manager "File | Run new task" this appears to be the closest system context to what is being used in the Task Scheduler. This provided the best error message for actually fixing my problem.
1
  • 1
    What is the same about your issue and this one? Oct 19, 2015 at 20:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .