πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Call a .bat

#8104
From: Valentino Kyriakides
Date: Wed, 18 Apr 2001 09:21
59 lines
3044 bytes
Try to use the full absolute path, e.g. "x:\\path\\xxx.bat".

Beside that, there is a general OpenTool addin which allows you to execute
arbitrary batch files from inside the JB IDE. Since this comes with source
code I think you can enhance it or take it as an example, so it fulfills
your needs. See:

http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=14705

Generally the technics to execute batch or script files from inside of JB
are pretty easy to setup. In my JDW OpenTool I've setup support for the
execution of batch, js, bas, perl, Unix script  etc. and all in all it were
at most just 20 lines of code you need. - However, under W2K you should only
take care for paths to batch files which might include spaces etc. since
these aren't always Java's friends. So you might generally better quote such
paths ("path").

BTW, there is also some JB supplied OTAPI example in the JB samples folder,
which shows you how be able to show/edit batch files from inside of JB.

Valentino

<icsd.jt@wanadoo.fr> schrieb im Newsbeitrag news:3add2ebb_2@dnews...
> Hello
> I have try this
>    ...
>     Runtime rt=Runtime.getRuntime();
>     try
>     {
>     Process proc = rt.exec(".\\xxx.bat");
>   ...
>   ( The file xxx.bat is in the directory of the .jpx
>      and naturaly this xxx.bat run alone correctly )
> A DOS windows is effectively open but he is
> empty : the .bat does not run.
> Have you an idea ?
> I have try this in NT5 (Windows Pro 2000)
> Thank , Jacques
>
> "John McGrath [TeamB]" <ng-b@JPMcGrath.net> a οΏ½crit dans le message news:
> MPG.15407bdc296cf9bd98a11a@forums.borland.com...
> > On Tue, 10 Apr 2001 17:55:03 +0200, icsd.jt@wanadoo.fr wrote:
> >
> > > what is the best way for call a xxx.bat from an
> > > JB4 appli ?
> >
> > To call a bat file from a Java application, use the Runtime exec()
> > method.
> >
> > --
> > Regards,
> >
> > John McGrath [TeamB]
> >
> > ---------------------------------------------------
> > Before sending me e-mail, please read:
> >     http://www.JPMcGrath.net/newsgroups/e-mail.html
>
>
Technical Details
Message-ID: <3add5d5f_2@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!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
X-Google-Thread: f74b3,1b19f5d9dbd32d49
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-04-18 02:33:20 PST
From: "Valentino Kyriakides" <vkyr@nospamlavielle.com>
Newsgroups: borland.public.jbuilder.java.language
References: <3ad32ca1$1_2@dnews> <MPG.15407bdc296cf9bd98a11a@forums.borland.com> <3add2ebb_2@dnews>
Subject: Re: Call a .bat
Date: Wed, 18 Apr 2001 11:21:45 +0200
Lines: 61
Organization: ISION
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
NNTP-Posting-Host: 194.64.62.36
Message-ID: <3add5d5f_2@dnews>
X-Trace: dnews 987585887 194.64.62.36 (18 Apr 2001 02:24:47 -0700)
Path: arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews