Detecting Windows boot-up state using GetSystemMetrics function
Using GetSystemMetrics function, we can detect how the system is started.
1 2 3 4 5 6 7 8 9 10 |
function WindowsStartUpState: string; begin case (GetSystemMetrics(SM_CLEANBOOT)) of 0: Result := 'Normal boot'; 1: Result := 'Fail-safe boot'; 2: Result := 'Fail-safe with network boot'; else Result := 'Unknown state'; end; end; |