SM_CLEANBOOT Value that specifies how the system was started:
0 Normal boot
1 Fail-safe boot
2 Fail-safe with network boot
Fail-safe boot (also called SafeBoot) bypasses the user's startup files.
procedure TForm1.Button1Click(Sender: TObject);
var
nRet:integer;
begin
nRet:=GetSystemMetrics(SM_CLEANBOOT);
case nRet of
0: label1.caption:='正常';
1: label1.caption:='安全模式';
2: label1.caption:='安全模式带网络连接';
end;
end;