Article View: borland.public.jbuilder.java.language
Article #17134Re: Executing DOS Program from JAVA
From: Steve Waters
Date: Fri, 11 Dec 1998 00:00
Date: Fri, 11 Dec 1998 00:00
57 lines
2081 bytes
2081 bytes
The dos part of the option that you manually type viz cd bin, then type
test.exe
seems to be the problem, what does test.exe do?
May I suggest that first you make sure you can run this, maybe a simple
test (one I always use in these circumstances, is to use notepad.exe
so change the code below, from bin to where your notepad.exe is,
and change test.exe to notepad.exe
if this works, maybe test.exe requires the the path be the directory
that test.exe is in.
Regards
Steve
Arumugam wrote:
> Hi,
> I tried to call the DOS program in my JAVA applications.
> I tried this way..
> -------------------
> String fileName = "bin/test.exe";
> String sys = System.getProperty("os.arch");
> String os = System.getProperty("os.name");
>
> try
> {
> Process p = Runtime.getRuntime().exec("start "+fileName);
> }
> catch(IOException e)
> {
> System.err.println("IOException : "+e);
> }
> ---------------------
>
> But I could not find any effect.
> The same thing happened when I did start bin/test.exe in the dos
> prompt.
> But in DOS, after changing the directory path to bin and executed
> start test.exe, it works fine.
>
> Please POINT me where I am wrong..!!! Please suggest me to solve
> this problem
>
> Thanks in advance
>
> Arumugam
>
> --
> B. Arumugam
> Mitsubishi Space Software, JAPAN.
> Phone ; +81-467-47-6708
> E-Mail : arumugam@kbo.mss.co.jp
>
>
Technical Details
Message-ID:
<3671DEEA.96F5D9A4@bellsouth.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3670AF84.1C7BBFF5@kbo.mss.co.jp>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,1b4b685d30b5edd2 X-Google-Attributes: gidf74b3,public From: Steve Waters <steve_w@bellsouth.net> Subject: Re: Executing DOS Program from JAVA Date: 1998/12/11 Message-ID: <3671DEEA.96F5D9A4@bellsouth.net> X-Deja-AN: 421409138 Content-Transfer-Encoding: 7bit References: <3670AF84.1C7BBFF5@kbo.mss.co.jp> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language