BlazeLondon Posted March 10, 2006 Share Posted March 10, 2006 does anyone know if it is possible to tell - if the system is in safe mode? -if the server is in active directory restore mode So I can If $mode = ..... Then Link to comment Share on other sites More sharing options...
DaveF Posted March 10, 2006 Share Posted March 10, 2006 does anyone know if it is possible to tell - if the system is in safe mode? -if the server is in active directory restore mode So I can If $mode = ..... ThenI'd compare running services. I don't know at the moment what normally running services are stopped in Safe Mode, but in preparation you could boot to Safe mode, AD Restore mode and normally and run sc query at a command prompt in each to list the running services and their running states. SC.EXE comes included with Win XP and Server 2003; you probably have to download it with the Windows 2000 Resource Kit for Win 2K systems. Having that and the AutoIt3 beta, you could test a service for running status with: ; Dim variables used Dim $ourProcess, $ourService, $output ; Init the service name we wish to test $ourService = "Themes" ; Run the SC query and capture the output from STDOUT $ourProcess = Run("sc query " & $ourService, @SystemDir, @SW_HIDE, 2) ; Loop and read from STDOUT until there's no more output While 1 $output &= StdoutRead($ourProcess) If @error = -1 Then ExitLoop WEnd ; Test for the string RUNNING in the output If StringInStr($output, "RUNNING") Then MsgBox(0, "Debug", "Service " & $ourService & " is running.") Else MsgBox(0, "Debug", "Service " & $ourService & " is not running.") EndIf Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted March 10, 2006 Moderators Share Posted March 10, 2006 (edited) You could check the SAFEBOOT_OPTION environment variable. Not sure if this will work for AD Restore Mode.$mode = EnvGet( "SAFEBOOT_OPTION" ) If $mode == "" Then MsgBox(0, "Safemode Status", "Your computer is not in safemode.") If $mode == "Minimal" Then MsgBox(0, "Safemode Status", "Your computer is in normal safemode.") If $mode == "Network" Then MsgBox(0, "Safemode Status", "Your computer is in safemode with networking.") If $mode == "DsRepair" Then MsgBox(0, "Safemode Status", "Your computer is in AD Restore Mode.") Edited March 10, 2006 by big_daddy Link to comment Share on other sites More sharing options...
DaveF Posted March 10, 2006 Share Posted March 10, 2006 (edited) You could check the SAFEBOOT_OPTION environment variable. Not sure if this will work for AD Restore Mode.Woot! Way to go, Big MO. According to this it's set to DsRepair in AD Repair mode. Edited March 10, 2006 by DaveF Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted March 10, 2006 Moderators Share Posted March 10, 2006 Woot! Way to go, Big MO. According to this it's set to DsRepair in AD Repair mode.Good find yourself! Updated my last post for AD Restore Mode. Link to comment Share on other sites More sharing options...
MHz Posted March 10, 2006 Share Posted March 10, 2006 Awesome, never seen that before. Good info big_daddy. Link to comment Share on other sites More sharing options...
BlazeLondon Posted March 11, 2006 Author Share Posted March 11, 2006 Awesome, never seen that before. Good info big_daddy.yeh really good info good man! Link to comment Share on other sites More sharing options...
CyberSlug Posted March 11, 2006 Share Posted March 11, 2006 This would make a good one for the UDF library.... Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now