Sinisterly
read ie page and change - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Coding (https://sinister.ly/Forum-Coding--71)
+--- Thread: read ie page and change (/Thread-read-ie-page-and-change)



read ie page and change - blowdoof - 06-16-2011

Used this a lot to fool ex-colleagues..
This script keeps running and checks if a certain page has been opened in IE.. if yes, you can choose an alternate page to display, as well as a little message to the user

So let's change that facebook into fuckbook and watch them turn red Wink
(Save as a .vbs file)
------------
do

Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows

If objShellWindows.Count = 0 Then
Wscript.Echo "No browser windows are open."
Wscript.Quit
End If

blnFound = False

For i = 0 to objShellWindows.Count - 1
Set objIE = objShellWindows.Item(i)
strURL = objIE.LocationURL
If InStr(strURL, "facebook")Then
blnFound = True
objIE.navigate "http://www.fuckbook.com"
End If
Next

If blnFound Then
Wscript.Echo "You've got new friends request Smile"
Else

End If

WScript.Sleep(20 * 1000)

loop
--------------

The 'WScript.Sleep(20 * 1000)' makes sure it checks every x ms to see if the 'facebook' part in the url has been found


Happy coding