This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes problem in copying files from/to different machines using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "problem in copying files from/to different machines using java" Watch "problem in copying files from/to different machines using java" New topic
Author

problem in copying files from/to different machines using java

Priyha Jootu
Ranch Hand

Joined: Sep 13, 2001
Posts: 47
Hi all,
I am trying to copy some files in a directory from one computer to another using java's Runtime.exec(). I want to copy some files from
\\d4598\public\soe_test\ directory to c:\try in my local machine. the "d4598" in the above is the machine name. I am mapping the remote machine d4598 to I: using "net use" command and then copying the files using "copy" command, but the copy command doesn't work, why is that?
Here's the code:

Since the copy didnt work, i tried to do it using the FileInputStream or bufferedstream, etc. First step is to see what files exist in that directory, even this doesn't work, what is wrong in my code, couldn't figure out.
Can anyone please help me with this?
Thanks,
Priyha
[ July 21, 2003: Message edited by: Priyha Jootu ]
Priyha Jootu
Ranch Hand

Joined: Sep 13, 2001
Posts: 47
The error I am getting when i run this is:

Anyone know what it says?
Thanks,
Priyha
 
wood burning stoves
 
subject: problem in copying files from/to different machines using java
 
Similar Threads
how can I append two files
Copying files.
Why is Runtime.getRuntime().exec() not working in JSP?
how to read files in a directory on a local network
PrintWriter.write(int c) Question