Article View: borland.public.jbuilder.java.language
Article #8106Re: Call a .bat
From: ainur
Date: Wed, 18 Apr 2001 14:51
Date: Wed, 18 Apr 2001 14:51
31 lines
1688 bytes
1688 bytes
There is a way to simply execute dos or window commands in Java with the
java Rumtime class
the dos or windows command is passed as a string:
like this:
try {
String command = "abatchfile.bat";
Process pc = Runtime.getRuntime().exec(command);
} catch(IOException) {
...errorcode..
}
or with parameters :
try {
String command[] = {"notepad.exe","afile.txt"};
Process pc = Runtime.getRuntime().exec(command);
} catch(IOException) {
...errorcode..
}
<icsd.jt@wanadoo.fr> schreef in bericht news:3ad32ca1$1_2@dnews...
> Hello
> what is the best way for call a xxx.bat from an
> JB4 appli ?
> Thank, Jacques
>
>
Technical Details
Message-ID:
<987605329.8571.0.pluto.c3adee5c@news.demon.nl>Path:
arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!diablo.netcom.net.uk!netcom.net.uk!dispose.news.demon.net!news.demon.nl!demon!ainur.demon.nl!not-for-mailReferences:
<3ad32ca1$1_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 07:52:35 PST Path: arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!diablo.netcom.net.uk!netcom.net.uk!dispose.news.demon.net!news.demon.nl!demon!ainur.demon.nl!not-for-mail From: <ainur> Newsgroups: borland.public.jbuilder.java.language Subject: Re: Call a .bat Date: Wed, 18 Apr 2001 16:51:16 +0200 Message-ID: <987605329.8571.0.pluto.c3adee5c@news.demon.nl> References: <3ad32ca1$1_2@dnews> NNTP-Posting-Host: ainur.demon.nl X-NNTP-Posting-Host: ainur.demon.nl:195.173.238.92 X-Trace: news.demon.nl 987605329 pluto:8571 NO-IDENT ainur.demon.nl:195.173.238.92 X-Complaints-To: abuse@nl.demon.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Lines: 33