Page 1 of 2 12>
Topic Options
#89384 - 2002-11-14 10:32 AM Run IE and enable proxy only for this windows
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
New challenge:

Users with no internet access (proxy disabled) must be allowed to visit one internet-address (for this they need proxy).

So is it possible to:
  • close all existing internet explorers
  • remember current proxy settings (yes, readvalue...)
  • apply correct proxy settings (yes, writevalue...)
  • start new explorer window with specified address (yes, createobject...)
  • prevent users from starting explorer again
  • if KiX explorer windows is closed restore previous proxy settings
  • allow new explorer windows
Running W95, KiX 4.11, WMI installed (not started automatically) <-- need more info???
_________________________
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
#89385 - 2002-11-14 10:36 AM Re: Run IE and enable proxy only for this windows
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Patrick ,

I think you can puzzle this together without using COM at all ... for the start of the Explorer window just use 'run www.dotnot.not', for preventing other instances use Radimus' Application killer script ... searching ...
_________________________



Top
#89386 - 2002-11-14 10:37 AM Re: Run IE and enable proxy only for this windows
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
doesn't the killer kill this too?
_________________________
!

download KiXnet

Top
#89387 - 2002-11-14 10:40 AM Re: Run IE and enable proxy only for this windows
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
patrick, what about renaming the iexplore.exe while running script?
should stop usage of it...
_________________________
!

download KiXnet

Top
#89388 - 2002-11-14 10:40 AM Re: Run IE and enable proxy only for this windows
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
You can always ammend it to leave one instance alive [Razz]
_________________________



Top
#89389 - 2002-11-14 10:43 AM Re: Run IE and enable proxy only for this windows
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
j, how then you know do you kill your own?
or, if the user closes our window, doesn't it leave one open then too?
_________________________
!

download KiXnet

Top
#89390 - 2002-11-14 10:47 AM Re: Run IE and enable proxy only for this windows
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
... tricky
_________________________



Top
#89391 - 2002-11-14 10:48 AM Re: Run IE and enable proxy only for this windows
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
maybe referencing Process ID ?

Shouldn'T be that hard
_________________________



Top
#89392 - 2002-11-14 10:53 AM Re: Run IE and enable proxy only for this windows
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
If RADIMUS' code ( X ) works on W95, I could:

kill all iexplore.exe
rename it
set proxy
start it
after exit rename it again
and finally restore old proxy settings

Problem is that after renaming the shortcuts and desktop E to IE generate errors...

Hmm, would this work:
copy wkix32.exe to iexplore.exe and place a kixtart.kix script in the same dir displaying a msg???

WIll let you know...
_________________________
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
#89393 - 2002-11-14 11:01 AM Re: Run IE and enable proxy only for this windows
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
why not make it an exe?
iexplore.exe selfextracting-selfexecuting-lockeddown-rar-package which has wkix32 and your message file?
_________________________
!

download KiXnet

Top
#89394 - 2002-11-14 02:55 PM Re: Run IE and enable proxy only for this windows
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Almost there...

looking for one thing:

Howto suppress a shell window starting an exe from within "Wkix32.exe /i"?
_________________________
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
#89395 - 2002-11-14 02:57 PM Re: Run IE and enable proxy only for this windows
Chris S. Offline
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 Offline
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
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#89397 - 2002-11-14 03:03 PM Re: Run IE and enable proxy only for this windows
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
patrick, could you translate this:
quote:
Howto suppress a shell window starting an exe from within "Wkix32.exe /i"?

where that shell window comes from?
_________________________
!

download KiXnet

Top
#89398 - 2002-11-14 03:05 PM Re: Run IE and enable proxy only for this windows
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
As I said , couldn't be that hard [Razz]
_________________________



Top
#89399 - 2002-11-14 03:13 PM Re: Run IE and enable proxy only for this windows
MightyR1 Offline
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
#89400 - 2002-11-14 03:57 PM Re: Run IE and enable proxy only for this windows
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
just change your line...
don't remember have I used 95 ever but in nt reskit there is kill and using it you can do:
Shell @scriptdir+"\kill iexplore.exe /f"

mm...
not sure does it flash another window or does it show it in same window.
if in same:
Shell @scriptdir+"\kill iexplore.exe /f 2>&1 >nul"

worky?

{edit}
if it still opens the window you can choose from 2:
1.Shell @scriptdir+"\kill iexplore.exe /f" setconsole("hide")
2.Shell "start "+@scriptdir+"\kill iexplore.exe /f"

[ 14. November 2002, 15:59: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#89401 - 2002-11-14 04:08 PM Re: Run IE and enable proxy only for this windows
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
At least I know that kill doesn't fire a console window if issued by start -> run
_________________________



Top
#89402 - 2002-11-14 04:13 PM Re: Run IE and enable proxy only for this windows
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
j, not true.
I have multiple times killed wkix32 that way and everytime it flashes the console window
_________________________
!

download KiXnet

Top
#89403 - 2002-11-14 04:29 PM Re: Run IE and enable proxy only for this windows
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Yeah correct,

didn't ever notice as it is really quick [Eek!]
_________________________



Top
Page 1 of 2 12>


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.076 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org