Microsoft Most Valuable Professional

Chris Pietschmann

An MVP From Wisconsin



.NET Framework - Check if Windows booted in Normal or Safe Mode

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

 

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General
Posted by crpietschmann on Friday, December 09, 2005 2:13 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Related posts

Comments are closed

About the author

I'm Chris Pietschmann, go to the About Me page to learn more about me.

Search

Sponsors

Web.Maps.VE - ASP.NET AJAX Virtual Earth Mapping Server Control

Recent comments

Disclaimer


This work is licensed under a Creative Commons Attribution 3.0 United States License, unless explicitly stated otherwise within the posted content.
© Copyright 2004 - 2008 Chris Pietschmann