Heres a really small code sample on how to check which mode Windows was booted up in (Normal or Safe Mode). This works in .NET 1.x and 2.0.
1 ’This code checks to see which mode Windows has booted up in. 2 Select Case System.Windows.Forms.SystemInformation.BootMode 3 Case BootMode.FailSafe 4 ’The computer was booted using only the basic files and drivers. 5 ’This is the same as Safe Mode 6 Case BootMode.FailSafeWithNetwork 7 ’The computer was booted using the basic files, drivers, and services necessary to start networking. 8 ’This is the same as Safe Mode with Networking 9 Case BootMode.Normal 10 ’The computer was booted in Normal mode. 11 End Select
This blog post is licensed under the Creative Commons Attribution 3.0 United States License, unless explicitly stated otherwise within the blog post content. All other content on this website is not licensed under Creative Commons licensing.