#89395 - 2002-11-14 02:57 PM
Re: Run IE and enable proxy only for this windows
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
This will close all open IE Windows...
code:
$objShell=CreateObject("Shell.Application") $objWindows=$objShell.Windows For $Index = 0 to $objWindows.Count-1 $objWindows.Item($Index).Quit Next
|
Top
|
|
|
|
#89396 - 2002-11-14 03:01 PM
Re: Run IE and enable proxy only for this windows
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
have the script: (pseoducode follows)
code:
findproc(@wksta,"iexplore.exe",1) writevalue() to enable proxy run ("%comspec% /c start www.msn.com") $currentIE = findproc(@wksta,"iexplore.exe")
$currentIE will be the PID of the one called by the code
you can then run it in a loop every X seconds returning the PIDS of all iexplore.exe and terminate all PIDS not $currentIE
if there $currentIE isn't running, use writevalue to disable proxy and findproc() to kill all IE windows
|
Top
|
|
|
|
#89399 - 2002-11-14 03:13 PM
Re: Run IE and enable proxy only for this windows
|
MightyR1
MM club member
Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
|
Here's the code:
code:
$ = SetConsole("MINIMIZE") $ = SetConsole("HIDE") Break on
$rc = MessageBox("Sluit alle andere Internet Explorer vensters."+ @crlf+"Na 2 minuten òf na het klikken op OK, worden ze automatisch gesloten!", "KiXtart message",49,120)
If 2 = $rc Exit 0 EndIf
Shell "%comspec% /c @scriptdir\kill95 iexplore.exe > nul"
$proxy = ReadValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable") $ = WriteValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable","1","REG_DWORD") $ = WriteValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyOverride","10.*.*.*","REG_SZ") $ = WriteValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer",";http=PROXYSERVER","REG_SZ")
$ = WriteValue("HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoFileOpen","1","REG_DWORD") $ = WriteValue("HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoFileNew","1","REG_DWORD") $ = WriteValue("HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoFindFiles","1","REG_DWORD") $ = WriteValue("HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoTheaterMode","1","REG_DWORD")
$ = WriteValue("HKLM\Software\Policies\Microsoft\Internet Explorer\Infodelivery\Restrictions", "NoSplash","1","REG_DWORD")
$ie = CreateObject("internetexplorer.application") $ie.addressbar = 0 $ie.menubar = 0 $ie.statusbar = 0 $ie.toolbar = 0 $ie.resizable = 0 $ie.Left = 10 $ie.top = 10 $ie.width = 1000 $ie.height = 700 $ie.navigate("about:blank") While $ie.busy AND $ie.readystate <> 4 AND @error=0 Loop $ie.visible=1
$ie.navigate("http://URL_TO_GO_TO") While $ie.busy AND $ie.readystate <> 4 AND @error=0 Loop
$ = WriteValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable",$proxy,"REG_DWORD")
Kill95 is the one from helpdesk.kixtart.org (if I remember correctly) and this is giving me the command box.
I run this script with "wkix32 /i"
WMI can't be used as it's not started... Starting also displays the box.
*** Gonna catch my train so will read your replies tomorrow... ***
_________________________
Greetz, Patrick Rutten
- We'll either find a way or make one... - Knowledge is power; knowing how to find it is more powerful... - Problems don't exist; they are challenges...
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 248 anonymous users online.
|
|
|