Error DataBase-One Place all Solutions Forums Blog Glossary    Contact Us
Search  
   
Browse by Category
Error DataBase-One Place all Solutions .: Operating Systems .: Windows Operating Systems .: Windows Scripts and Batch Files .: VB Script to Verify the Server name is reachable - if not, log information to the logfile

VB Script to Verify the Server name is reachable - if not, log information to the logfile

If err.number<>0 Then

'wscript.echo "There is an error connecting to " & UCASE(sServer) & VBCRLF & _

'            "Error #" & err.number & " - " & err.description

            s="~" & vbTAB & UCASE(sServer) & vbTAB & err.description

            'wscript.echo s

            Set fso = CreateObject("Scripting.FileSystemObject")

                        sPath = StrReverse(WSCript.ScriptFullName)

                        sPath = Right(sPath, Len(sPath) - (InStr(sPath, "\")-1))

                        sPath = StrReverse(sPath)   

                        Set f = fso.OpenTextFile(StrPath & sLogFile, ForWriting, True)

                        'Set f = fso.OpenTextFile(StrPath & "RemoteWINSConfig.log", ForWriting, True)

                        f.WriteLine s

            wscript.quit

End If

 

Err.Clear

 

 

oSvc.Security_.ImpersonationLevel=3


How helpful was this article to you?

Related Articles

article VB Script to add NEW DNS IP address information
sDNSServers =...

(No rating)  3-24-2008    Views: 161   
article VB Script to GET Domain membership information
Set oResults=oSvc.ExecQuery _ ...

(No rating)  3-24-2008    Views: 190   
article VBS Script To Send All AD Domain Controllers Disk Space Information To Excel
This VBS script will write all the Active...

(No rating)  4-21-2008    Views: 177   

User Comments

Add Comment
No comments have been posted.