-
Notifications
You must be signed in to change notification settings - Fork 0
/
Logout.vbs
37 lines (25 loc) · 871 Bytes
/
Logout.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if PingSite("www.google.com") Then
dim xHttp: Set xHttp = createobject("MSXML2.ServerXMLHTTP")
xHttp.Open "GET", "https://securelogin.pu.ac.in/cgi-bin/login?cmd=logout", False
xHttp.setOption 2, 13056
xHttp.Send
WScript.Echo "You are Logged Out!"
else
Wscript.Echo "Check Your Internet Connection"
end if
Function PingSite( myWebsite )
Dim intStatus, objHTTP
Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
objHTTP.Open "GET", "http://" & myWebsite & "/", False
objHTTP.SetRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MyApp 1.0; Windows NT 5.1)"
On Error Resume Next
objHTTP.Send
intStatus = objHTTP.Status
On Error Goto 0
If intStatus = 200 Then
PingSite = True
Else
PingSite = False
End If
Set objHTTP = Nothing
End Function