Scheduled Tasks Last Result code of 0x35

Posted on 2006-03-31
Last Modified: 2009-05-08
I'm trying to figure out what the Result code of 0x35 means from my Scheduled Tasks.  I know about the MS site: and the JSI Tip# 2911:  I've browsed around MSDN site for this error code also, but I'm just wondering what my specific code means.  My task is simply running the shutdown command to reboot a list of computers in a txt file.

Here's from the Scheduled Tasks Log file (the last 3 days):

"SysReboots.job" (cmd) 3/28/2006 11:17:01 PM ** WARNING **
      Invalid working directory..
      The specific error is:
      0x00000002: The system cannot find the file specified.
      Verify that the directory exists and try again.
"SysReboots.job" (cmd)
      Started 3/28/2006 11:17:01 PM
"SysReboots.job" (cmd)
      Finished 3/28/2006 11:43:33 PM
      Result: The task completed with an exit code of (35).
"SysReboots.job" (cmd) 3/29/2006 11:17:01 PM ** WARNING **
      Invalid working directory..
      The specific error is:
      0x00000002: The system cannot find the file specified.
      Verify that the directory exists and try again.
"SysReboots.job" (cmd)
      Started 3/29/2006 11:17:01 PM
"SysReboots.job" (cmd)
      Finished 3/29/2006 11:45:12 PM
      Result: The task completed with an exit code of (35).
"SysReboots.job" (cmd) 3/30/2006 11:17:01 PM ** WARNING **
      Invalid working directory..
      The specific error is:
      0x00000002: The system cannot find the file specified.
      Verify that the directory exists and try again.
"SysReboots.job" (cmd)
      Started 3/30/2006 11:17:01 PM
"SysReboots.job" (cmd)
      Finished 3/30/2006 11:41:17 PM
      Result: The task completed with an exit code of (35).
[ ***** Most recent entry is above this line ***** ]

I've double-checked the file and location and it seems correct.  Here is what is displayed about my schedule task by using the "cmd /c schtasks /query /fo list /v > C:\tasksdetails.txt " command:

HostName:                             My_Hostname
TaskName:                             SysReboots
Next Run Time:                        11:30:00 PM, 3/31/2006
Logon Mode:                           Interactive/Background
Last Run Time:                        11:17:01 PM, 3/30/2006
Last Result:                          53
Creator:                              Administrator
Schedule:                             At 11:30 PM every day, starting 3/24/2006
Task To Run:                          cmd /c for /f %a in (E:\PCList.txt) do shutdown -m \\%a -r -f
Start In:                             cmd
Comment:                              N/A
Scheduled Task State:                 Enabled
Scheduled Type:                       Daily
Start Time:                           11:30:00 PM
Start Date:                           3/24/2006
End Date:                             N/A
Days:                                 Everyday
Months:                               N/A
Run As User:                          %My_Domain%\administrator
Delete Task If Not Rescheduled:       Disabled
Stop Task If Runs X Hours and X Mins: 6:0
Repeat: Every:                        Disabled
Repeat: Until: Time:                  Disabled
Repeat: Until: Duration:              Disabled
Repeat: Stop If Still Running:        Disabled
Idle Time:                            Disabled
Power Management:                     Disabled

If anyone has an idea for this and can explain to me what the Last Result code means, that would be great.

Thank you,

Question by:rmurdockfed
    LVL 23

    Expert Comment

    1.  I would recommend using PSsshutdown from sysinternals:
      no reason for the for statement, etc.

    2.  I thought 35 was an invalid command line parameter.  Does the task work straight from a command prompt with no errors?
    LVL 3

    Author Comment

    I'll have to try it manually from the command line tonight and see.  If this doesn't workout, I may have to try the PsShutdown option to see if that works, but it'd be a lot less hassle if I didn't have to install that on everyone's machine.

    On my list of computers that are scheduled to reboot, will it error out if one of the computers on this list is already shutdown?  The list is around 100 computers long.  Also, is there a limit to how long the list can be?  I tried this manually from the command line using a list of 5 computers and that seemed to work fine, so I was assuming a larger list shouldn't matter much.
    LVL 23

    Assisted Solution

    1.  You don't have to install PsShutdown on everyone's machine, just the 2003 server you are running the task from.

    2.  PsShutdown works much better with the "input file" you want to use.  It will continue on through the list if it cannot reach a particular computer.  No limit to the # of computers in the list that I'm aware of.

    Personally I think Psshutdown in this instance is superior.  It uses the shutdown command built into windows, but adds the functionality you are looking for.
    LVL 82

    Accepted Solution

    The exit code of 35 in the log file is hexadecimal, and it's the same one as the 53 (decimal) in the schtasks output: "Network path not found".
    The command is obviously running, as it's taking around 17 seconds from start to end:
    > "SysReboots.job" (cmd) 3/30/2006 11:17:01 PM ** WARNING **
    >      Finished 3/30/2006 11:41:17 PM

    But your main error is listed in plain sight:
    >     Invalid working directory..
    Have a close look at the schtasks output:
    > Start In:                             cmd
    There is no such directory on your machine; change this to %Systemroot%\system32, and you should be fine.
    There's basically no limit to the length of the list, and the shutdown command will time out if the target machine can't be reached.
    LVL 3

    Author Comment

    @TheCleaner- I must have been having one of those days.  I wasn't thinking that I only needed PsShutdown on the server itself.

    @oBdA- Thanks for the clarification.  That's what the problem was and it solved it.  The job runs fine now without error.

    I'm splitting the points between the both of you.  I'm accepting oBdA's answer because he/she pointed out the problem and solution.  I'm giving points to TheCleaner because I also got PsShutdown working as well.  I know I will be using this in the future for more tasks.

    Thank you both.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now