Search code examples
delphiwinapiwindows-7safe-mode

Windows7 Force boot to Safe mode via API


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.


Solution

  • 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.