Article View: borland.public.jbuilder.java.language
Article #7808Re: Runtime Exec Example
From: Rich Wilkman
Date: Tue, 15 May 2001 16:02
Date: Tue, 15 May 2001 16:02
31 lines
1654 bytes
1654 bytes
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:
<3B0152F8.116A0D04@formlessvoid.com>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>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:11:06 PST Message-ID: <3B0152F8.116A0D04@formlessvoid.com> Date: Tue, 15 May 2001 09:02:00 -0700 From: Rich Wilkman <richw@formlessvoid.com> X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: Re: Runtime Exec Example References: <3b013312$1_1@dnews> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 208.236.69.60 X-Trace: dnews 989942519 208.236.69.60 (15 May 2001 09:01:59 -0700) Lines: 31 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