Results 1 to 2 of 2
- 01-16-2009, 09:40 AM #1
Member
- Join Date
- Dec 2008
- Posts
- 4
- Rep Power
- 0
Running batch files thraugh java by passing parameters
Hi
I want to run a batch file by passing some parameters.
Eg: copy.bat "D:\live\hoe.txt" "D:\test"
while doing this from command prompt its working and i have written some java code for running this batch file.
String live="D:\\live\\how.txt";
String test="D:\\test";
String bat="D:\\copy.bat";
String[] command = new String[3];
command[0] = bat;
command[1] = live;
command[2] = test;
try {
Runtime.getRuntime().exec(command);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
but this time its not copying the file;
Please help.
- 01-16-2009, 10:14 AM #2
Similar Threads
-
Batch Files in java
By coco in forum New To JavaReplies: 3Last Post: 12-05-2008, 01:30 PM -
Running batch files in java
By pradeesh in forum New To JavaReplies: 10Last Post: 12-04-2008, 09:26 PM -
passing parameters to paint mtd
By themburu in forum Java AppletsReplies: 3Last Post: 07-14-2008, 08:15 PM -
passing parameters between two applets
By veena1612 in forum Java AppletsReplies: 1Last Post: 05-27-2008, 09:29 AM -
JNI - passing and returning parameters by value
By java_to_c in forum New To JavaReplies: 0Last Post: 01-31-2008, 08:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks