[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

windows help!

ahoward

9/26/2003 4:57:00 PM

3 Answers

Rodrigo B. de Oliveira

9/26/2003 7:01:00 PM

0

If you just need to open an URL you can `start #{url}` and windows will fire
the default web browser (guess which?).

[]s,
Rodrigo


----- Original Message -----
From: "Ara.T.Howard" <ahoward@fsl.noaa.gov>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Sent: Friday, September 26, 2003 3:46 PM
Subject: windows help!


>
>
> o.k. - i suk with windows.
>
> any clue how one would determine the path of, and exec IE5 in windoze? do
i
> need to assume, as in unix, that it should be in the path? does
ENV[''PATH'']
> do the same thing? could i be any more clueless? ;-)
>
> any links you windoze guys could suggest?
>
> thanks!
>
> -a


Chris Morris

9/26/2003 7:02:00 PM

0

Ara.T.Howard wrote:

>o.k. - i suk with windows.
>
>any clue how one would determine the path of, and exec IE5 in windoze? do i
>need to assume, as in unix, that it should be in the path? does ENV[''PATH'']
>do the same thing? could i be any more clueless? ;-)
>
If you wanna go the COM route:

require ''win32ole''
ie = WIN32OLE.new(''InternetExplorer.Application'')
ie.visible = true
ie.navigate(''http://ruby-lang.org...)

Otherwise, try:

`start iexplore`

(The start dealy is a little bit of magic ... it''s not just in the path,
or at least not on my machine).

--

Chris
http://clabs....



Bernard Delmée

9/26/2003 10:25:00 PM

0

> (The start dealy is a little bit of magic ... it''s not just in the path,
> or at least not on my machine).

It''s a command internal to the command interpreter which gets
spawned by the backtick operator. This solution has the drawback
of launching a DOS console. A 3d possibility is the following:

require ''Win32API''

SW_SHOWNORMAL = 1
mydoc = ''index.html''

se = Win32API.new(
''shell32'',
''ShellExecute'',
[''L'',''P'',''P'',''P'',''P'',''L''],
''L'' )

se.Call(0,''open'',mydoc,0,0,SW_SHOWNORMAL)

This will launch the correct application associated with
"mydoc", not just html.