Sign in to follow this  
Followers 0
SadBunny

Determining whether Win is running in safe mode or not

3 posts in this topic

#1 ·  Posted (edited)

Hi people! I am writing a big script for our support department to be able to tech-support customers better, and offering a lot of basic task automation to make it all more efficient.

I am now trying to determine what basic dimensions to use for initial gui creation on a random customer's machine. This depends however on whether Windows is running in safe mode or not, since this obviously impacts the screen resolution.

So does anyone have any idea where to read out a Windows safe mode status?

(Edit: I can just try out screen resolution, but would like to be able to use the safe-mode-or-not info for more tasks...)

Thanks in advance.

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites



Several ways to do this. Here's one:

$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
For $objItem In $colItems
  ConsoleWrite("BootupState: " & $objItem.BootupState & @CR)
Next

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

I figured there were multiple ways, I just couldn't find any :P

But thanks to your super fast suggestion I know one way now; this is exactly what I needed.

Thanks a bunch!


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0