Page 1 of 1 1
Topic Options
#130146 - 2004-11-25 10:32 AM open a webpage
guenti Offline
Fresh Scripter

Registered: 2000-09-29
Posts: 26
Loc: Switzerland
hello
can i open a simple webpage from a kix-script.
i try to open the following
www.sbb.ch

thanks
guenti

Top
#130147 - 2004-11-25 10:37 AM Re: open a webpage
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure you can open it.
question is, do you want to open it just for the user to see it?
and if so, do you want to control the flow or just open the window and let user have the control of it after that?

if you don't to just have user viewable window but you want to do something with it, do you need to retrieve some info back from the browser and is that info inserted by user or do you even want to have totally hidden window that can even download binary files?

all is possible.
what is the one you want?
_________________________
!

download KiXnet

Top
#130148 - 2004-11-25 11:45 AM Re: open a webpage
guenti Offline
Fresh Scripter

Registered: 2000-09-29
Posts: 26
Loc: Switzerland
ok, i only have to open a webpage for a user so that he can see and navigate it.

thanx
marc

Top
#130149 - 2004-11-25 11:59 AM Re: open a webpage
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
like this:
Code:
run 'explorer "http://www.sbb.ch"'


?
_________________________
!

download KiXnet

Top
#130150 - 2004-11-25 12:18 PM Re: open a webpage
guenti Offline
Fresh Scripter

Registered: 2000-09-29
Posts: 26
Loc: Switzerland
shit i try it with
run 'iexolrer http......'

thanx

Top
#130151 - 2004-11-25 01:22 PM Re: open a webpage
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
You can use Internet Explorer, but as it is not normally on your search path you must provide an explicit path to it.

This method launches IE explicitly - useful if you have another application associated with URLs, or if you have a strange URL.

Code:
$sURL="http://www.microsoft.com"

$sIEexe=ReadValue("HKLM\SOFTWARE\Classes\Applications\iexplore.exe\shell\open\command","")
Run Join(Split($sIEExe," %1")," "+$sURL)


Top
#130152 - 2004-11-25 01:30 PM Re: open a webpage
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and this obviously is not needed if you use my example above that uses EXPLORER.
_________________________
!

download KiXnet

Top
#130153 - 2004-11-25 02:21 PM Re: open a webpage
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Quote:

and this obviously is not needed if you use my example above that uses EXPLORER.




Uh-uh, it's not at obvious as that. The point of my post is that while using EXPLORER (should) launch a browser, it just might not be the one you were expecting.

Say you have an alternative browser (FireFox, Netscape, Opera) installed and configured to handle URLs, or you have a URL which is not recognised by EXPLORER.

If you specifically want to open the URL using IE (maybe the page uses an IE specific add-in), you cannot rely on the associations that EXPLORER will use to determine the application.

Top
#130154 - 2004-11-25 02:51 PM Re: open a webpage
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja, if you can't rely on the associated being the right one, then you indeed should make sure.
_________________________
!

download KiXnet

Top
#130155 - 2004-11-26 04:57 AM Re: open a webpage
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Another gotcha to watch out for...if you run EXPLORER as a published app in citrix or TS, it will load the full desktop.
Top
#130156 - 2004-11-26 07:59 AM Re: open a webpage
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ah...
ja, in such env you probably need to dig back to command prompt and shoot the addy from there...
or just simply read the name of the executable from the registry.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


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

Who's Online
0 registered and 534 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.062 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

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