- Script that checks for a custom registry key/value under HKCU
- If the key exists, skip the browser launch and move on
- If the key is not found, open the browser and create the registry key/value
'****************************************************************
Dim objIE, objShell, keyval
Const delay = 5000
Const regkey = "HKCU\Software\MyCustomKey\PageViewed"
Set objShell = CreateObject("Wscript.Shell")
keyval = ""
On Error Resume Next
keyval = objShell.RegRead(regkey)
If keyval = "" or IsNull(keyval) Then
'wscript.echo "registry key was not found - opening browser"
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("http://mysite/legal")
objIE.Visible = True
objIE.FullScreen = True
objShell.RegWrite regkey, Now, "REG_SZ"
Else
'wscript.echo "page already viewed"
End If
Set objShell = Nothing
No comments:
Post a Comment