Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Edit Report
can we run dos command using java Posted by rajan on 5 Jan 2001 at 6:11 AM

I have a simple problem that can we run a dos command
like(dir/w,copy con& etc) if can pls tell me how

pls tell u'r e-mail add to
thank u for spending time


Edit Report
Re: can we run dos command using java Posted by nils on 5 Jan 2001 at 6:59 AM
Here we go:

try{
Runtime r = Runtime.getRuntime();
Process win = r.exec("C:\\WINNT\\explorer.exe");
Process unix = r.exec("/usr/bin/ls");
}catch(Exception e){
System.out.println(e);
}

It is too bad that you cannot call EXEs
directly which are in your PATH-environment variable.

Reg, nils



Edit Report
Re: Re: Re: can we run dos command using java Posted by rajan on 6 Jan 2001 at 10:16 PM
: Here we go:
:
: try{
: Runtime r = Runtime.getRuntime();
: Process win = r.exec("C:\\WINNT\\explorer.exe");
: Process unix = r.exec("/usr/bin/ls");
: }catch(Exception e){
: System.out.println(e);
: }
:
: It is too bad that you cannot call EXEs
: directly which are in your PATH-environment variable.
:
: Reg, nils
:
:
thank u verymuch nils






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.