Windows7 Force boot to Safe mode via API

2019-03-01 03:45发布

问题:

Is there a way via the Windows API or altering a file to reboot the computer in safemode with Network support. (Windows 7)

For Windows 2000 and XP you could simply add '/safeboot:network' to the boot.ini file.

However with Windows 7 there is no such file.

My goal is to code this using Delphi, but any language code samples would be appreciated.

回答1:

I think you have to edit the BCD file. there is a command line utility bcdedit that can do this (set SAFEBOOT to NETWORK). I don't know how to use CMD utilities from delphi, sorry.