We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Scheduled Tasks Last Result code of 0x35

rmurdockfed asked
Medium Priority
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: http://support.microsoft.com/kb/308558/en-us and the JSI Tip# 2911:  http://www.jsifaq.com/subf/tip2900/rh2911.htm.  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,

Watch Question

1.  I would recommend using PSsshutdown from sysinternals:  http://www.sysinternals.com/Utilities/PsShutdown.html
  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?


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.
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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Most Valuable Expert 2019
Most Valuable Expert 2018
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.


@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.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.