Windows task scheduler shows error 0xE0434352

Alper Ertürk 21 Reputation points
2022-08-17T18:27:54.353+00:00

Hello Microsoft community,

I have created a task in which an exe is to be executed.
If I enter as user 'Administrators' or 'PREDEFINEDT\Administrators', the program works. But the button 'Execute independently of the user login' is disabled, which I need.

No matter with which other user I tried, the program gives the error 0xE0434352 and is not working.
Accounts I have tried:
SYSTEM, Localadmin, Domainadmin, User with 'logon as batch job'.
This should be incredibly simple but why is it not working, what am I missing?

The event display always shows the same Application Error 1000 and .Net Runtime Error 1026 no matter if the program works or not.

Kind regards,

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,458 questions
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 31,571 Reputation points
    2022-08-19T01:24:51.717+00:00

    What does this program do? Is this a commercial program or something that you or someone in your organization developed?

    If it's "your code", then have your developer add proper error handling and logging functionality to it so that you know exactly what the program was trying to do and what error it got. There should be a global try/catch to intercept errors. Key processing events along with errors should be written to a log file so that you can troubleshoot unattended executions of the program like you are trying to do with the task scheduler.

    If this is a commercial program, they typically have logging built in. Consult the product documentation or contact product support and find out how to enable logging. (Have you checked the Windows Application event log?)

    Hopefully this is a command line program that writes to stdout/stderr. Configure the scheduled task to capture that output.

    Create a bat file that executes your program. Echo %date% %time% as the first and last line the .bat so that know when the task starts and ends.

    @echo %date% - %time% MyScript is starting.  
    SomeProgram.exe    
    @echo %date% - %time% MyScript is ending. SomeProgram RC=%errorlevel%    
    

    Then change the scheduled task to execute program "cmd.exe".

    In the arguments field set it like this example:

    /c C:\Scripts\MyScript.bat  1>>"C:\Scripts\Logs\MyScript-%date:~10,4%-%date:~4,2%%date:~7,2%.log" 2>&1  
    

    That will create a daily log file of all executions of the task. That will capture stdout and stderr for programs that get called. Review that log for errors.

    If the program accesses network shares, add a "dir" command to the bat file to verify that the account that the task runs as has access to the share.


0 additional answers

Sort by: Most helpful