12

Why would a brief power-down of a windows 11 pro server not constitute a re-boot?

After a recent re-boot I was investigating why a task scheduled against the trigger 'At system startup' hadn't run. Eventually I discovered that the reboot time was listed as two weeks previously - this explains why the task didn't run, it hadn't realised the system had restarted.

My question is...

Why did this shutdown, followed by being physically disconnected from the power for over a minute NOT constitute a reboot? or to put a different slant on the issue why is my lastBootTime still showing as a date two weeks ago?

Some more details and a bit of background...

Anticipating a brief interruption of power I closed all applications, manually powered down (clicked on 'start' followed by 'power' followed by 'shutdown'), then waited for the screen to die and the lights on the computer to switch off. The computer was then physically unplugged from the mains for about 120 seconds before being plugged in and the power button pressed.

The task that I was expecting to start normally works successfully in the event of an automated update, or after accidental power failures.

The method for determining the last boot time is discussed in this thread

2 Answers2

23

I will answer the reboot vs shutdown start up part. Feel free to ask new questions for what remains.

Windows 8 and up have a new feature called Hybrid shutdown. When you turn off the computer, windows will close all programs, log off the user, and then puts the computer in hibernation.

You turn the computer on, the computer comes out of hibernation, and you get to the login screen. If there's just one user, the system automatically logs you in.

This basically makes it so that any driver remains loaded at all times, which significantly reduces startup time.

When you reboot a computer, it actually quits Windows, and all drivers are unloaded too. The computer goes to the UEFI boot sequence too, then loads all the drivers and then continues to start Windows.

So long story short, Windows does not actually start up when you use hybrid shutdown and turn off and on the computer, but it does so when you reboot, or perform a normal shutdown (either turn off hybrid shutdown from Power Management, or hold shift while you perform the shutdown to do it once.)

Keltari
  • 75,447
LPChip
  • 66,193
8

A re-boot (as described in the question) is actually the precursor to a fast-start. The kernel is saved (to disc) in a hibernation file, this file is retained even in the event of the computer being disconnected from power.

When the computer is next started, the hibernation file is used to bring the machine back to it's previous state as quickly as possible and preserves most of the existing settings including the previous value of lastBootUpTime. Long story short, a fast-start doesn't really count as a re-boot. This is why the task scheduler doesn't start those events triggered 'At system startup'.

Selecting restart rather than shutdown will skip the fast-start process, lastBootUpTime will be updated and tasks triggered by 'At system startup' will run. In a similar fashion, a re-start triggered by an automatic update will also skip the fast-start process.

I don't claim credit for this answer - it's more of summary of other answers and comments.