🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8112

Re: Call a .bat

#8112
From: John McGrath TeamB
Date: Thu, 19 Apr 2001 03:57
26 lines
1861 bytes
On Wed, 18 Apr 2001 08:06:58 +0200, icsd.jt@wanadoo.fr wrote:

> A DOS windows is effectively open but he is
> empty : the .bat does not run.
> Have you an idea ?

When Java runs a subprocess with one of the Runtime exec() methods, 
it pipes the standard streams for the process back to the Java VM.  
You can use the Process object returned from the exec() method to 
write to the process's input stream and read from its output and 
error streams.

Note that since there are two different streams to be read, you have 
to create threads to do this.  And if there is any chance that the 
process will produce output, ignoring this could cause the process to 
hang.  Exactly when this will happen is system dependant, since it 
depends on the buffering of those pipes.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.15481d6b4b2de75498a138@forums.borland.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!dispose.news.demon.net!demon!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3ad32ca1$1_2@dnews> <MPG.15407bdc296cf9bd98a11a@forums.borland.com> <3add2ebb_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,1b19f5d9dbd32d49
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-04-18 21:16:05 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: Call a .bat
Date: Wed, 18 Apr 2001 23:57:57 -0400
Message-ID: <MPG.15481d6b4b2de75498a138@forums.borland.com>
References: <3ad32ca1$1_2@dnews> <MPG.15407bdc296cf9bd98a11a@forums.borland.com> <3add2ebb_2@dnews>
X-Newsreader: MicroPlanet Gravity v2.30
NNTP-Posting-Host: 209.92.40.60
X-Trace: dnews 987652682 209.92.40.60 (18 Apr 2001 20:58:02 -0700)
Lines: 26
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!dispose.news.demon.net!demon!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews