Pages

Monday, July 22, 2013

How to block a site in IE using DOMscript

Copy this code into a notepad and save it as .vbs file and double click on it and see the fun!!!
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sFlag = ""
While sFlag <> "WorkDone"
Set oShellObj = CreateObject("Shell.Application")
Set oShellWinObj = oShellObj.Windows
For Each obj In oShellWinObj
on error resume next
Do
    WScript.Sleep 1000
    iWaitCount = iWaitCount + 1
    If iWaitCount = 30 Then
        Exit Do
    End If
Loop until obj.ReadyState = 4
If lcase(obj.Document.Title) = "gmail: email from google" Then
obj.Navigate "about:blank"
sFlag = ""
msgbox "No '"& obj.Document.Title &"' please!!!"
end if
Next
Set oShellObj = Nothing
Set oShellWinObj = Nothing
wend
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
When you want to stop this, go to task manager and kill the process wscript.exe

No comments: