Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE Pop-Up option

Status
Not open for further replies.

ckugo

IS-IT--Management
Jan 6, 2004
165
0
0
US
I really need a script that will either enable / disable the Internet Explorer pop-up blocker that came with SP2. Anyone have any ideas??

Thanks,

Chris
 
I know this is very bad design, but this is a quick script that I developed after I posted my last post. I just thought I would share it with everyone. Like I mentioned, very bad design, but it does do the job. Here it is:

dim strKey,Value,check
Dim WSHShell

if msgbox("Would you like to enable the Pop-Up Blocker?",vbyesno,"Enable/Disable Pop-Ups") = "6" then

Set WSHShell = WScript.CreateObject("WScript.Shell")
on error resume next
strKey=WSHShell.RegRead ("HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMGR")
if err.number = 0 then
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMGR", "1"
Else

If strKey = "" then
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMGR", "1"
end If


end if

check=WSHShell.RegRead ("HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMGR")

if check = "1" then
msgbox "Pop-Up Blocker has been successfully enabled."
end if

else

Set WSHShell = WScript.CreateObject("WScript.Shell")
on error resume next
strKey=WSHShell.RegRead ("HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMGR")
if err.number = 0 then
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMGR", "0"
Else

If strKey = "" then
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMGR", "0"
end If

end if

check=WSHShell.RegRead ("HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMGR")
if check = "0" then
msgbox "Pop-Up Blocker has been successfully disabled."
end if

end if



ENJOY!

Chris

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top