task scheduler return code 0xc0000135 (Not .NET)

Jim Schwartz 41 Reputation points
2022-08-04T11:49:10.81+00:00

I'm trying to run a .cmd script that I've created that calls an executable created from python code that uploads to an AWS S3 bucket. I'm getting that error code. I uninstalled my intel support driver utility and I ran sfc scannow and corrected the errors, but I still get this in task scheduler. How do I fix this? It pipes output from the .cmd script to a log file, but it's empty, so that's no help. When I run the script manually by double clicking on it, it runs fine. It's being run as an administrator, too.

Developer technologies | Universal Windows Platform (UWP)
Windows for business | Windows Client for IT Pros | Devices and deployment | Set up, install, or upgrade
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 36,291 Reputation points
    2022-08-05T02:17:58.517+00:00

    It pipes output from the .cmd script to a log file,

    Are you capturing both stdout and stderr?

    Configure the task to execute program cmd.exe. In the arguments field set it like this.

    /c c:\scripts\myscript.cmd 1>c:\scripts\myscript.log 2>&1   
    
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. S.Sengupta 24,476 Reputation points MVP
    2022-08-05T00:58:34.267+00:00

    In Start Seach type taskschd.msc and hit the Enter key.

    Inside your Task Scheduler, navigate to the task that is creating the issue, right-click on it and select Properties from the context menu.

    Inside the Properties screen of the task, go to the Settings tab and change the drop-down menu at the bottom of the screen to Stop the existing instance.

    Click OK.

    0 comments No comments

  2. Jim Schwartz 41 Reputation points
    2022-08-05T12:21:21.153+00:00

    @MotoX80 I have the piping of the output happening in my script, since I determine the name of the log file using the current time and date. I do it like this. I tried what you said without the piping of the log file, but it didn't work. Like I said, it works when I double click on the .cmd file in file explorer. Thanks for the help.

    Here's what my script does:

    echo on
    SET CURRENTTIME=%TIME%
    IF "%CURRENTTIME:~0,1%"==" " (SET CURRENTTIME=0%CURRENTTIME:~1%)
    FOR /F "tokens=2-4 delims=/ " %%A IN ('DATE /T') DO (SET TIMESTAMP=%%C-%%A-%%B_%CURRENTTIME%)
    SET TIMESTAMP=%TIMESTAMP::=_%
    SET LOGNAME="%AWS_LOG_LOCATION%System_Backup_%TIMESTAMP%.log"
    echo "LOGNAME IS " %LOGNAME%
    "%AWS_COPY_BACKUPS_EXECUTABLE%" -b:"F:\My Backups\New System Backup\\" -p:"[{'bucket': '%C_DRIVE_BUCKET%'},{'file_mask': 'C_VOL-.*'},{'files': 3},{'duration': 1}]" -l:"[{'boto3': 'DEBUG'}, {'botocore': 'DEBUG'}, {'aws_copy_backups': 'DEBUG'}]" -2:"[{'boto3': 'DEBUG'}, {'botocore': 'DEBUG'}, {'aws_pc_backup': 'DEBUG'}]" -t:"C:\Temp_Download\\" 1> %LOGNAME% 2>& 1


  3. Jim Schwartz 41 Reputation points
    2022-08-05T12:27:32.19+00:00

    @S.Sengupta I tried that and that didn't work either. I still get the same return code. Thanks for the help.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.