How to

detect save mode in Windows

Published: 26. January 2009 | Updated: 26. September 2011
License: Microsoft Public License (MS-PL)
Categories: Windows
Tags: C# Windows Winforms
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.Windows.Forms;

Code

if (SystemInformation.BootMode != BootMode.Normal)
{
    Console.WriteLine("System is running in safe mode");
}
else
{
    Console.WriteLine("System is running in normal boot mode");
}
Send us feedback about this snippet »



Related Snippets: