Re: How do I run a batch file when a server reboots?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Marten" <absolute88@xxxxxxxxxxx> wrote in message
news:qi3k94ls4v0186mknv40vbmbhbm72e5sj4@xxxxxxxxxx
On Wed, 6 Aug 2008 21:46:06 +0200, "Pegasus \(MVP\)"
<I.can@xxxxxxxxxx> wrote:


for the record, the Shutdown command used is:
C:\WINDOWS\system32\shutdown.exe /r /d p:4:1

Marten

I'm quite aware of the syntax for the shutdown command . . .

Running a command at boot time (the equivalent of Autoexec.bat)
is dead easy: Use the Task Scheduler to run it at boot time.
However - how will you distinguish between a boot after a
scheduled shutdown and a boot caused by a crash?

About trimming the log file: If you schedule a reboot once every
week then you accumulate some 2 kBytes per annum. I would
not call this a huge amount of disk space - it's puny, so why worry?


My apologies for a grammatical error. I should have written "the
Shutdown command as I am using it is:" I added it in case you saw
something that was incorrect or if someone else reading this thread
wanted to know what I had done.

I haven't worked much with the scheduler. I wasn't aware there was an
at boot option. Thank you for pointing it out to me. As for
distinguishing, since I know the time of the scheduled reboot, I'd
expect anything outside that time frame would be questionable.

The >> redirect is a consideration. I was originally only concerned
with the last reboot.

Thank you for the information. It helps me out.

Marten

Thanks for the feedack.


.



Relevant Pages

  • Re: How do I run a batch file when a server reboots?
    ... I'm quite aware of the syntax for the shutdown command. ... Running a command at boot time ... I haven't worked much with the scheduler. ...
    (microsoft.public.windows.server.scripting)
  • Re: [RFC] Kernel boot cache to reduce boot time
    ... A large portion of kernel boot time is spent in driver probe functions ... drivers to identify and record such values (LPJ, camera type, decoder ...
    (Linux-Kernel)
  • Re: [RFC] Kernel boot cache to reduce boot time
    ... A large portion of kernel boot time is spent in driver probe functions ... drivers to identify and record such values (LPJ, camera type, decoder ...
    (Linux-Kernel)
  • Re: Testing Linux Retail Speed
    ... The currently recommended RAM for Vista on the street (as opposed to ... I've got 1.5GB on this dual boot machine and XP still crawls compared to ... However, its successor, WinXP ... boot time from switch on). ...
    (uk.comp.os.linux)
  • Laptops/Ubuntu/etc. (was: Gloomy Sunday)
    ... the 'complaint' menu at next boot time, ... I'm kinda holding out for Core i7 processors to arrive in "normal" laptops; ... primes in about 8.5 seconds. ...
    (uk.misc)