Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / December 2006

Tip: Looking for answers? Try searching our database.

how to execute commands.

Thread view: 
Prajwal - 28 Dec 2006 10:58 GMT
Hello ,
Am new to java.
   i want to go inside some drive and execute some commands ther.is ther
any option of doing the same using java RUNTIME class.

Regds,
Prajwal.
RedGrittyBrick - 28 Dec 2006 11:49 GMT
> Hello ,
> Am new to java.

I recommend you try Google before posting here. Google will often
provide an answer quicker than newsgroups can.

>     i want to go inside some drive

Translation: I want to use something equivalent to a 'cd' or 'chdir'
command to change the current directory in a Java application.

There is some interesting background on this notion. Google for "Java
chdir" - see the Sun bug report for a discussion of the issues for the JVM.

> and execute some commands ther.is ther

s/ther.is ther/there. Is there/

> any option of doing the same using java RUNTIME class.

Translation: Is there any way to do this using Java's Runtime class?

I assume you are referring to Runtime.getRuntime.exec(String[] command),
and that you are passing relative filenames as parameters to a command.

I occasionally find it useful to read the documentation for the methods
I want to use, you might like to try doing this as well ...
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html#exec(java.lang.St
ring,%20java.lang.String[],%20java.io.File
)>

Note the part where it says "dir - the working directory of the
subprocess, or null if the subprocess should inherit the working
directory of the current process."
Sundar - 29 Dec 2006 09:57 GMT
Hi Prajwal,

I could not understand your problem. I think you need to give more
details to understand the problem.

What do you ant to do inside the directory??
  - Get a list of files in the directory?
  - Delete/Create files inside the directory??

You might give more details about your problem to help you.

-Sundar

> > Hello ,
> > Am new to java.
[quoted text clipped - 28 lines]
> subprocess, or null if the subprocess should inherit the working
> directory of the current process."


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.