forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Safe Mode

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DW
Contributor
Contributor


Joined: 21 Mar 2003
Posts: 175
Location: UK

PostPosted: Sun May 16, 2004 8:18 am    Post subject: Safe Mode Reply with quote

How can I detect if windows is in safe mode?
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Tue May 18, 2004 12:56 am    Post subject: Reply with quote

I would like to know myself...that is a good question i hope some one can answer it....sorry DW i don't know Sad
_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue May 18, 2004 6:57 am    Post subject: Reply with quote

Maybe Windows sets a variable to "Safe mode" or something when it is in safe mode (just like it sets the current user into a variable). You can check it with this code:

Code:
runh cmd.exe /c set,pipe
info @pipe()

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Tue May 18, 2004 12:10 pm    Post subject: Reply with quote

Here's some VB code to do this:
Code:
Option Explicit
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright ©1996-2004 VBnet, Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Declare Function GetSystemMetrics Lib "user32" _
     (ByVal nIndex As Long) As Long

Public Const SM_CLEANBOOT = 67


Private Sub Command1_Click()

  Select Case GetSystemMetrics(SM_CLEANBOOT)
     Case 1: Label1.Caption = "System started in Safe Mode."
     Case 2: Label1.Caption = "System started in Safe Mode with network support."
     Case Else: Label1.Caption = "Windows is running normally."
  End Select

End Sub
'--end block--'


I'll try and make a VDS script out of this in a little bit. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue May 18, 2004 1:48 pm    Post subject: Reply with quote

This should work (converted from FreezingFire's example... Smile).

Code:
#define function,WindowStatus

info Windows is running: @WindowStatus()

exit

:WindowStatus
loadlib user32
%1 = @lib(user32,GetSystemMetrics,INT:,INT:67)
if @equal(%1,1)
  %1 = SAFEMODE
elsif @equal(%1,2)
  %1 = SAFEMODEWITHNETWORK
else
  %1 = NORMAL
end
freelib user32
exit %1

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Tue May 18, 2004 9:17 pm    Post subject: Reply with quote

ok Skit made a script so I wont post mine that I said I was working on.
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed May 19, 2004 5:23 pm    Post subject: Reply with quote

Maybe you can still post it, in case I made an error (since I haven't tested it)... Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group