[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

How to "open" a file in its default application - Windows XP

Its Me

11/11/2004 7:36:00 PM

How do I open a file in its default windows application on XP?

(In this case it is a graphics file I just generated)

Thanks


7 Answers

Logan Capaldo

11/11/2004 7:40:00 PM

0

system("#{filename}") should do it, IIRC


On Fri, 12 Nov 2004 04:38:28 +0900, itsme213 <itsme213@hotmail.com> wrote:
> How do I open a file in its default windows application on XP?
>
> (In this case it is a graphics file I just generated)
>
> Thanks
>
>


Its Me

11/11/2004 8:31:00 PM

0


"Logan Capaldo" <logancapaldo@gmail.com> wrote in message
> system("#{filename}") should do it, IIRC
>
> > How do I open a file in its default windows application on XP?

That would make sense, but it does nothing. Return value is false.


Florian Gross

11/11/2004 8:49:00 PM

0

itsme213 wrote:

>>>How do I open a file in its default windows application on XP?
>>system("#{filename}") should do it, IIRC
> That would make sense, but it does nothing. Return value is false.

Try using system("start", filename) instead.

gabriele renzi

11/11/2004 8:52:00 PM

0

itsme213 ha scritto:

> How do I open a file in its default windows application on XP?
>
> (In this case it is a graphics file I just generated)
>

maybe system("start filename")

Ivan Vodopiviz

11/11/2004 8:58:00 PM

0

On Fri, 12 Nov 2004 05:53:28 +0900, gabriele renzi
<rff_rff@remove-yahoo.it> wrote:
> maybe system("start filename")
yes, i just tried it from the command line:

start text.txt

and it works

--
BlueSteel | | Merkoth


Its Me

11/11/2004 9:32:00 PM

0

That did the trick, thanks.

"Florian Gross" <flgr@ccan.de> wrote
> Try using system("start", filename) instead.


timsuth

11/11/2004 10:04:00 PM

0

In article <2vi1h8F2l7domU1@uni-berlin.de>, Florian Gross wrote:
>itsme213 wrote:
>
>>>>How do I open a file in its default windows application on XP?
>>>system("#{filename}") should do it, IIRC
>> That would make sense, but it does nothing. Return value is false.
>
>Try using system("start", filename) instead.

As an alternative, the ShellExecute win32 function
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/shelle...

takes a filename and a verb (such as "open") and does what you want.

You could use ruby-dl to access it.