Link to home
Start Free TrialLog in
Avatar of rmurdockfed
rmurdockfed

asked on

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
Avatar of TheCleaner
TheCleaner
Flag of United States of America image

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?
Avatar of rmurdockfed
rmurdockfed

ASKER

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.
SOLUTION
Avatar of TheCleaner
TheCleaner
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@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.