read ie page and change 06-16-2011, 09:27 AM
#1
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
(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
"
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
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

(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

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