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

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

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

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")

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

yes, i just tried it from the command line:

start text.txt

and it works

···

On Fri, 12 Nov 2004 05:53:28 +0900, gabriele renzi <rff_rff@remove-yahoo.it> wrote:

maybe system("start filename")

--
BlueSteel | | Merkoth

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.

That did the trick, thanks.

···

"Florian Gross" <flgr@ccan.de> wrote

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

As an alternative, the ShellExecute win32 function

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

You could use ruby-dl to access it.

···

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.