Page 1 of 2 12>
Topic Options
#39681 - 2003-04-29 04:27 PM get current web page
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
I searched for "get current web page" and did not find what I needed.

What I need:
I have a script that will close IE/NS change the proxy settings and then reopen IE/NS. But it opens to the default home page and I would like it to open to the last page it was on when the script closed it.

Any thoughts?

TIA,
Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#39682 - 2003-04-29 05:24 PM Re: get current web page
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Rocco,

Can't you take the page you are going to and write a value to HKCU\Kixtart and then read that back when you re-open it?

It would then be -

iexplore.exe http://www.site.com

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#39683 - 2003-04-29 05:28 PM Re: get current web page
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Kent thanks, I know that once I get the page I can save it to any variable and then use it to open ie/ns again. problem is how do I determine the current page that is open in ie/ns.

This script will be run by sales reps and I know if I close ie/ns on them and don't open the same page they had open I'll here about it. (as if they run the whole company [Mad] )

does this explain more?

Rocco

PS. Ha www.site.com is a real site! [Big Grin]
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#39684 - 2003-04-29 08:05 PM Re: get current web page
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well...
back in june 2001 at a time of first generation checker 1.0, this was something I did.

it checked the latest cached file which always was the correct one.
with checker though, the scan time of 1-2 second was little too much but should suite you.
_________________________
!

download KiXnet

Top
#39685 - 2003-04-29 08:41 PM Re: get current web page
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Could you post a snipet of that code? [Big Grin]

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#39686 - 2003-04-29 09:05 PM Re: get current web page
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Rocco,

Just an FYI, if your afraid of losing thier page then I probably wouldn't do this either. Any HTTPS page they happen to be on probably will not open to the same page as it will not be allowed as it is now a new connection.

Also, page their on may be password protected and they may need to enter the password again to get back in, and it may or may not go to the exact same page.

Either way, there are plenty of possible failures that may PISS OFF your Clients and reflect badly on you if not handled properly.

Top
#39687 - 2003-04-29 09:27 PM Re: get current web page
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
I guess the old...
code:
$RC=$Form.MsgBox('You need to close and re-open your web browser'+@CRLF+
'in order for the settings to take effect.',
'Proxy Settings',48)

...is the way to go... [Roll Eyes]

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#39688 - 2003-04-29 09:31 PM Re: get current web page
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
now, why you need to close the windows and open them again?

what is that?
what is the thing that makes you do it while person is logged on and browsing?

also, it can surely open the same page, don't worry about that.
the problem might be that he is on secured connection so users continuing from that page might be impossible.
_________________________
!

download KiXnet

Top
#39689 - 2003-04-29 09:35 PM Re: get current web page
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Origanal post... Change Proxy Settings ... I do this via regisrty. So IE/NS has to be closed and reopened to grab the new settings.

Is there a way to do that without needing to close and open the browser?
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#39690 - 2003-04-29 09:38 PM Re: get current web page
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no!
WHY is the question.
I know what you are doing but why to do it when there is someone logged on and browsing???

why you can't do it at any other point...
mostlikely the user is browsing 30 mins a day so you have 23 hours 30 mins time to do it.

why you must do it when it is most harmfull?
_________________________
!

download KiXnet

Top
#39691 - 2003-04-29 09:46 PM Re: get current web page
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Oh,

lets see if I can explain this...

Sales rep comes in to office and logs into network, by default they run the login script, Thus thier proxy settings are modified to let them connect to the internet. They leave the office and go home/hotel/wherever, they cannot get to the internet due to the proxy settings. (NOTE: Users too dim to manually turn off proxy settings.)
Windows 2000 users have 'LogOff' script that turns off settings. (Don't need to worry about them.)
Windows NT and 9X users do not.

Does that answer the '?'

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#39692 - 2003-04-29 11:11 PM Re: get current web page
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what you mean is that they bring the computer with them?
thus the same proxy setting does not work outside the network...

now I must wonder, can't there be automatic proxy enabled?
or do the settings via DHCP?

I still can do this...
anyway, they can't go to any page if their proxy settings are wrong.

so it does not matter where they try to go if they are unable to go [Wink]
_________________________
!

download KiXnet

Top
#39693 - 2003-04-29 11:22 PM Re: get current web page
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
RAS proxy connections are seperate from the LAN settings

therefore LAN can be set to proxy, and the RAS connections can be whatever you need independantly of each other

is this what you need?
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#39694 - 2003-04-29 11:59 PM Re: get current web page
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
You can also put a shortcut on the desktop that disables or enables the proxy as needed.

Have the user click that. Heck there used to clicking stuff without reason anyways.

We use that method here and it seems to work fine for us. Cheap easy method. During logon we re-enable the proxy.

Top
#39695 - 2003-04-30 02:07 PM Re: get current web page
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
DOC!, That's what I am doing.
Here's the code...
code:
BREAK ON
;----------------------------------------------------------------------------------------
GLOBAL $IEArray, $NSArray
;----------------------------------------------------------------------------------------
$Form=CreateObject('Kixtart.Form')
$Form.Caption='ITSoft - Proxy Settings'
$Form.Width=450
$Form.Height=250
$Form.SysMenu=1
$Form.BackColor=204,204,204
$Form.FontName='Courier'
$Form.FontSize=10
$Form.Center
;----------------------------------------------------------------------------------------
$Logo=$Form.Image(@SCRIPTDIR+'\proxy_title.bmp',-6,0,450,80)
$Logo.Border=0
;----------------------------------------------------------------------------------------
$Frame1=$Form.Frame('',5,80,435,110)
;----------------------------------------------------------------------------------------
$Label1=$Form.Label('NOTE:',15,95)
$Label2=$Form.Label('You need to close and re-open your web browser',15,110)
$Label3=$Form.Label('in order for the settings to take effect.',15,125)
$Label4=$Form.Label('-> The Proxy Settings.',220,156)
$EnableY=$Form.OptionButton('Enable ',20,151)
$EnableN=$Form.OptionButton('Disable ',120,151)
$EnableY.Enabled=1
$EnableY.Value=1
$EnableN.Enabled=1
;----------------------------------------------------------------------------------------
$Submit=$Form.CommandButton('GO!',285,195,70,22)
$Cancel=$Form.CommandButton('Close',365,195,70,22)
$Submit.OnClick='Submit_Click()'
$Submit.Default=1
$Cancel.OnClick='Cancel_Click()'
;----------------------------------------------------------------------------------------
$Form.Show
;----------------------------------------------------------------------------------------
WHILE $Form.Visible
$RC=Execute($Form.DoEvents())
LOOP
;----------------------------------------------------------------------------------------
QUIT(1)
;----------------------------------------------------------------------------------------
Function Cancel_Click()
$RC=$Form.Hide
EndFunction
;----------------------------------------------------------------------------------------
Function Submit_Click()
IF($EnableY.Value=1)
SHELL '%COMSPEC% /C '+@SCRIPTDIR+'\pv.exe -e -q iexplore.exe > ie.dat'
SHELL '%COMSPEC% /C '+@SCRIPTDIR+'\pv.exe -e -q netsc*.exe > ns.dat'
$RC=Open(1,@SCRIPTDIR+'\ie.dat',2)
$IEdat=ReadLine(1)
$RC=Close(1)
IF($IEdat<>'')
$IEArray=Split($IEdat,Chr(9))
$IE_exe=$IEArray[3]
ENDIF
$RC=Open(2,@SCRIPTDIR+'\ns.dat',2)
$NSdat=ReadLine(2)
$RC=Close(2)
IF($NSdat<>'')
$NSArray=Split($NSdat,Chr(9))
$NS_exe=$NSArray[3]
ENDIF
SHELL '%COMSPEC% /C '+@SCRIPTDIR+'\pv.exe -k -f iexplore.exe'
SHELL '%COMSPEC% /C '+@SCRIPTDIR+'\pv.exe -k -f netsc*.exe'
SELECT
;*--------------------------------------------------------------------
CASE(InGroup('Mansfield'))
$RC=WriteValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\','ProxyEnable','1','REG_DWORD')
$RC=WriteValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\','ProxyServer','172.16.0.214:8080','REG_SZ')
$RC=WriteValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\','ProxyOverride',
'*.schoolspecialty.com;*.junebox.com;<local>','REG_SZ')
;*--------------------------------------------------------------------
CASE(
(InGroup('Junebox'))OR
(InGroup('Cedar Falls'))OR
(InGroup('Lyons'))OR
(InGroup('Southaven'))OR
(InGroup('Sportime'))OR
(InGroup('SportimeCS'))OR
(InGroup('Appleton'))OR
(InGroup('IS Dept'))OR
(InGroup('Fresno'))
)
$RC=WriteValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\','ProxyEnable','1','REG_DWORD')
$RC=WriteValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\','ProxyServer','10.56.1.214:8080','REG_SZ')
$RC=WriteValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\','ProxyOverride',
'*.schoolspecialty.com;*.junebox.com;<local>','REG_SZ')
;*--------------------------------------------------------------------
CASE 1
;?'[ WebMarshal ]'
ENDSELECT
IF($IEdat<>'')
RUN $IE_exe
ENDIF
IF($NSdat<>'')
RUN $NS_exe
ENDIF
$Label5=$Form.Label('Proxy Settings = ON',20,200)
ELSE
SHELL '%COMSPEC% /C '+@SCRIPTDIR+'\pv.exe -e -q iexplore.exe > ie.dat'
SHELL '%COMSPEC% /C '+@SCRIPTDIR+'\pv.exe -e -q netsc*.exe > ns.dat'
$RC=Open(1,@SCRIPTDIR+'\ie.dat',2)
$IEdat=ReadLine(1)
$RC=Close(1)
IF($IEdat<>'')
$IEArray=Split($IEdat,Chr(9))
$IE_exe=$IEArray[3]
ENDIF
$RC=Open(2,@SCRIPTDIR+'\ns.dat',2)
$NSdat=ReadLine(2)
$RC=Close(2)
IF($NSdat<>'')
$NSArray=Split($NSdat,Chr(9))
$NS_exe=$NSArray[3]
ENDIF
SHELL '%COMSPEC% /C '+@SCRIPTDIR+'\pv.exe -k -f iexplore.exe'
SHELL '%COMSPEC% /C '+@SCRIPTDIR+'\pv.exe -k -f netsc*.exe'
$RC=WriteValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\','ProxyEnable','0','REG_DWORD')
$RC=WriteValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\','ProxyServer','0.0.0.0:0000','REG_SZ')
$RC=WriteValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\','ProxyOverride',
'*.schoolspecialty.com;*.junebox.com;<local>','REG_SZ')
IF($IEdat<>'')
RUN $IE_exe
ENDIF
IF($NSdat<>'')
RUN $NS_exe
ENDIF
$Label5=$Form.Label('Proxy Settings = OFF',20,200)
ENDIF
EndFunction

I use proccesview (http://www.xmlsp.com/pview/prcview.htm) in there. it comes with pv.exe (command line version).

You can see how I check if ie/ns is open then I close it, do the proxy settings, and then re-open it. Now the login script at work will take care of turning it on, so that part will prolly be left off in the final release.

I just thought it would be nice to open ie/ns up back up to the last page they were on.

Feel free to improve this, especially if there is a way to not use any 3rd party addons. Keep in mind there are Win9X users.

Thanks,
Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#39696 - 2003-04-30 02:14 PM Re: get current web page
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, you have 2 ways to go with the last page.

but, as said, the user can't be on any page if his proxy is wrong, just like I said before.

thus the page you will give them will be the page they accessed when they were last at work!

way 1:
use shell-object to get all IE-object handles and their current addresses.

way 2:
get any of the dirscan udfs from UDF Collection...
well, any of the ones that work recursively.
check the modification time of each .htm file and there you go.

once more I say:
if what you say is true, they can't be on any website what so ever before your script corrects the proxy, so there is no nice thing doable.
_________________________
!

download KiXnet

Top
#39697 - 2003-04-30 02:47 PM Re: get current web page
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
OH MY GOSH! I'm such an idiot! [Roll Eyes]

Your right, duh, if they can't get to a site because the proxy is on there is no web page to get. [Eek!]

My humble appologies to all for my lack of common sence!!

Rocco [Embarrassed] [Frown]

I gusee what i have is what I need then, duh.
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#39698 - 2003-04-30 05:23 PM Re: get current web page
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Can make the proxy decision based on the IP address or a PING? If there's no webpage, then there might not be a PING either. And put the script as a AutoRun script onto the laptop separate from the login script.
_________________________
There are two types of vessels, submarines and targets.

Top
#39699 - 2003-04-30 05:27 PM Re: get current web page
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Yeah, that was my thought too. Have a script check for proxy before IE/NS even loads. This could be done by stuffing the Run key or by scheduled task.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#39700 - 2003-04-30 07:43 PM Re: get current web page
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
When I said a SHORTCUT on the users desktop, all it does is run a .REG file and changes the proxy.

No KiX or KiXforms involved. Very fast, very easy. Just train the user, if it don't work one way, close IE, click the shortcut and reload IE.

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 1452 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.081 seconds in which 0.033 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