BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

open / execute

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder JavaAPI
View previous topic :: View next topic  
Author Message
Ralph Steins
Guest





PostPosted: Thu Oct 23, 2003 8:36 pm    Post subject: open / execute Reply with quote



Hi,

I need a functionality similar to the "open" function in the
(windows)explorer. "open" a file with the corresponding application. Is
there something?

I can use Runtime.exec() only with the application name. I would favour a
more flexible way because at programming time are not all types of
applications known.
(btw: is it possible to get registered applications from the os (like Word
for *.doc, *.dot)?)

Ralph


Back to top
Shankar Unni
Guest





PostPosted: Fri Oct 24, 2003 6:26 pm    Post subject: Re: open / execute Reply with quote



Ralph Steins wrote:

Quote:
I need a functionality similar to the "open" function in the
(windows)explorer. "open" a file with the corresponding application. Is
there something?

This is fairly windows-specific functionality, but at least on Windows,
you can easily emulate this by doing the following (provided that the
file extension is already registered with Windows):

String[] args = { "cmd", "/c", "start", yourfilename };
Process p = Runtime.getRuntime().exec(args);

(You'll have to do some OS checking: for WinME, 98 and 95, you'll have
to use "command" rather than "cmd", but otherwise the same syntax).
--
Shankar.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder JavaAPI All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.