I have the following problem: I need to know when the PC start, if the computer has started up after being turned off (cold start), or if the computer has simply been restarted (hot start). Through a startup script set in gpedit, I should know the answer, something like:
If PC restarted then
msg: The PC has been warm reboot
elseif PC shutdown then
msg: The PC has been cold reboot
end if
(note: in fact an email is sent, but this particular is not important).
Now, I ask the community, how can I recover this information from the system? My starting point is the "Eventviewer" tool, but I'm not very satisfied with this solution. I think ACPI events are stored in the BCD store and I wonder if it is possible to recover them in any way. Perhaps through WMIC? Or also, is there a system log file from which it is possible to retrieve the information directly?
Does anyone have any ideas on how to proceed?
Note: for now, I'm only interested in the Windows environment, but I think it is also interesting for the Unix and Unix like (such as Linux).