Article View: borland.public.jbuilder.java.language
Article #7809Re: Runtime Exec Example
From: Sara Swartz
Date: Tue, 15 May 2001 16:09
Date: Tue, 15 May 2001 16:09
43 lines
2016 bytes
2016 bytes
Thanks so much!
This will be running on Win98 and (to a lesser extent) on NT.
Under which circumstances would I preface the command with the items that
you mentioned?
Thanks Again
"Rich Wilkman" <richw@formlessvoid.com> wrote in message
news:3B0152F8.116A0D04@formlessvoid.com...
> Sara:
>
> What version of Windows? Basically:
>
> Runtime.getRuntime().exec("the exact command you would do at the dos
> prompt").
>
> However you may need to preface the command with command.com /c or
> cmd.exe
> or start
>
> You can quickly see how, even on one OS, Runtime.exec is not exactly
> portable.
>
> -Rich
>
> Sara Swartz wrote:
> >
> > Hi,
> >
> > Can anyone show me an example of using a dos command in a Java program?
> > Ideally, I would like to run the commands in the program and not have to
> > call a batch file, but if that isn't possible, how I would call the
batch
> > file?
> >
> > The command would remap (and later un-map) the user's Z: drive. Is it
> > possible to do that in Java without having to go through the batch file
at
> > all?
> >
> > Thanks,
> > Sara
Technical Details
Message-ID:
<3b01558b$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b013312$1_1@dnews> <3B0152F8.116A0D04@formlessvoid.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,b8415ce0c4751a66 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-05-15 09:40:59 PST From: "Sara Swartz" <sara_swartz@lnospamorienti.com> Newsgroups: borland.public.jbuilder.java.language References: <3b013312$1_1@dnews> <3B0152F8.116A0D04@formlessvoid.com> Subject: Re: Runtime Exec Example Date: Tue, 15 May 2001 12:09:21 -0400 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 63.98.29.194 Message-ID: <3b01558b$1_2@dnews> X-Trace: dnews 989943179 63.98.29.194 (15 May 2001 09:12:59 -0700) Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews