Scheduled Tasks Last Result code of 0x35

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
Status:                              
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,

rmurdock
LVL 3
rmurdockfedAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheCleanerCommented:
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?
0
rmurdockfedAuthor Commented:
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.
0
TheCleanerCommented:
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.
0
oBdACommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rmurdockfedAuthor Commented:
@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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.