How can I tell if Windows was cold booted or restarted?

August 20, 2025 1 answer
Asked by 0.6 grams of pepper
I'm trying to set up a task that should only run when Windows starts from a completely powered-off state, but if it's just a restart, I want to skip it. I've looked into possible methods, but most suggestions involve checking timestamps in the Event Log, which hasn't yielded clear results. I'm wondering if there are any recent updates in Windows or PowerShell that could help differentiate between a cold boot and a warm reboot.

Answers

FIRST.aid.training
You can easily use the Event Log to differentiate between cold and warm boots. The log generates different event IDs based on the boot type, so you could write a simple script to scan through it and respond accordingly.

Crinkly: I checked the Event Log, and I only saw event ID 6009 for both types. Are there other IDs I'm missing?

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions