PC Review


Reply
Thread Tools Rate Thread

Scheduled task will not run as scheduled!

 
 
alex.birchall@gmail.com
Guest
Posts: n/a
 
      3rd Dec 2009
Hi,

The situation is this:

I am trying to make use of the psshutdown.exe tool available from
Sysinternals (http://technet.microsoft.com/en-us/sysinternals/
bb897541.aspx) to reboot a Windows 2000 Professional server.

I have a batch file containing the following:

@echo off
c:
cd\
cd pstools
psshutdown -f -r

goto EOF

:EOF
exit

This batch file is saved in the root of C:

I can run this batch file manually (i.e., double-click on it and it
works - the computer restarts).

I set up a scheduled task to run this batch file at a specified time
in the future.

If I choose to run the scheduled task now, I can and it works.

But if I leave the scheduled task set up and lock the computer, the
scheduled task will not run. The Last Result appears to indicate it
ran successfully (0x0), but it demonstrably has not.

I have exactly the same scheduled task set up on a different Windows
2000 server and it works.

I'm stumped! Can anyone explain this mystery?

Many thanks in anticipation.

Alex Birchall
 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a
 
      3rd Dec 2009

"(E-Mail Removed)" <(E-Mail Removed)> wrote in message
news:3f9dfdec-34d8-4e59-a622-(E-Mail Removed)...
> Hi,
>
> The situation is this:
>
> I am trying to make use of the psshutdown.exe tool available from
> Sysinternals (http://technet.microsoft.com/en-us/sysinternals/
> bb897541.aspx) to reboot a Windows 2000 Professional server.
>
> I have a batch file containing the following:
>
> @echo off
> c:
> cd\
> cd pstools
> psshutdown -f -r
>
> goto EOF
>
> :EOF
> exit
>
> This batch file is saved in the root of C:
>
> I can run this batch file manually (i.e., double-click on it and it
> works - the computer restarts).
>
> I set up a scheduled task to run this batch file at a specified time
> in the future.
>
> If I choose to run the scheduled task now, I can and it works.
>
> But if I leave the scheduled task set up and lock the computer, the
> scheduled task will not run. The Last Result appears to indicate it
> ran successfully (0x0), but it demonstrably has not.
>
> I have exactly the same scheduled task set up on a different Windows
> 2000 server and it works.
>
> I'm stumped! Can anyone explain this mystery?
>
> Many thanks in anticipation.
>
> Alex Birchall


Throw out some of the superfluous stuff from your batch file, then run this
version instead:

@echo off
echo %date% %time% %UserName% >> c:\test.txt
c:\PSTools\psshutdown -f -r 1>>c:\test.txt 2>>&1

Now allow the job to be run under the Task Scheduler, then examine the file
c:\test.txt. You will most likely find that the job *did* run, even though
you're convinced that it did not. You will probably also find the reason why
it did not shut down the machine as expected.

Remember that scheduled tasks must be run under an account that has a
non-blank password.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need info on scheduled meetings: time scheduled/who scheduled it Joe Bruin Microsoft Outlook Calendar 1 24th Mar 2010 08:36 PM
What happens if a scheduled task is scheduled to start, but theprevious task execution is still running? joe.carr@gmail.com Windows XP General 1 17th Dec 2007 08:32 PM
Add Scheduled Task wizard in Scheduled Tasks won't run =?Utf-8?B?U01GYWlzb24=?= Microsoft Windows 2000 4 12th May 2005 12:26 AM
On startup get failed to run scheduled task for user account, but there is no task scheduled! kifoghorn Windows XP Help 0 18th Apr 2005 07:05 PM
HELP: Desktop/Task Bar MISSING after Windows 2000 startup, but I can start desktop/task bar manually by issuing the 'CONTROL' command from TASK MANAGER/NEW TASK/RUN/CONTROL aniceguy45@hotmail.com Microsoft Windows 2000 0 4th Oct 2003 03:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:17 PM.