windows help!

A

Ara.T.Howard

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

====================================
| Ara Howard
| NOAA Forecast Systems Laboratory
| Information and Technology Services
| Data Systems Group
| R/FST 325 Broadway
| Boulder, CO 80305-3328
| Email: (e-mail address removed)
| Phone: 303-497-7238
| Fax: 303-497-7259
| The difference between art and science is that science is what we understand
| well enough to explain to a computer. Art is everything else.
| -- Donald Knuth, "Discover"
| ~ > /bin/sh -c 'for lang in ruby perl; do $lang -e "print \"\x3a\x2d\x29\x0a\""; done'
====================================
 
R

Rodrigo B. de Oliveira

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" <[email protected]>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <[email protected]>
Sent: Friday, September 26, 2003 3:46 PM
Subject: windows help!
 
C

Chris Morris

Ara.T.Howard said:
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).
 
B

Bernard Delmée

(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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top