can any one help Me? please..

hi,

this is achari,

i am trying to use copy command in java program with the syntax like the below

Process pr=Runtime.getRuntime().exec('cmd /c copy c:\*.txt c:\aaa\");

but its getting an exeception with the escape sequences. so how do i can specify the path as a directory structure.

if any body can solve this please help me. i am in very very urgency to do this.

you can contact me at : aachi_win@yahoo.co.in

[455 byte] By [acharia] at [2007-11-26 22:21:20]
# 1
Try double backslashes instead of single ones. "\\" instead of "\"PS.
puckstopper31a at 2007-7-10 11:19:02 > top of Java-index,Java Essentials,Java Programming...
# 2

Everywhere you need a single backslash, put two:

Process pr=Runtime.getRuntime().exec("cmd /c copy c:\\*.txt c:\\aaa\\");

The first backslash escapes the second.

Also, the single ' should be " (probably just a typo in your post).

And don't forget code tags (button above posting box).

doremifasollatidoa at 2007-7-10 11:19:02 > top of Java-index,Java Essentials,Java Programming...
# 3
thank you very much, if u dont mind may i do the same for copying into another system named as jeevan and also sharedlike" cmd /c xcopy c:\\*.* \\\\jeevan\\aaa"please do not ignore.. thank you once again.
acharia at 2007-7-10 11:19:02 > top of Java-index,Java Essentials,Java Programming...
# 4
thank you,i did it.thank you very much. if you dont mind may i know your mail id to add my contacts list.achari
acharia at 2007-7-10 11:19:02 > top of Java-index,Java Essentials,Java Programming...