cmd - Is it posible to copy a folder from another computer using a java application locally? -


before have copied files computer , that's not problem. when try opposite, can't. i'm trying copy files computer, i'm running program in mine. i'm using java, windows xp, , have privileges use folder.

this code:

string rutao = "pc1234/folder/"; //the folder want copy string rutad = "d:/reportes"; // want put other folder runtime.getruntime().exec("cmd /c copy \"" + rutao + "\"  \\\\" + "" + rutad + ""); 

i'd appreciate help.


well code looks like:

string rutac = "pcvw234103r\\retrabajos_ks1_2014";  string rutao = "d:\\retrabajos_ks1_2014\\generales\\" + nombrec + ".pdf"; runtime.getruntime().exec("cmd /c copy \"" + rutao + "\" \\\\" + "" + rutac + ""); 

and @ end pass cmd:

cmd /c copy "d:\retrabajos_ks1_2014\generales\turbina ruidosa(material suelto),nuevo formato.pdf" \\pcvw234103r\retrabajos_ks1_2014 

that's how copy files computer one, need opposite) :(

your basic problem need break comnand , arguments separate strings, this:

runtime.getruntime().exec("cmd", "/c", "copy", "\"" + rutao + "\"", "\\\\" + rutad); 

the first argument passed exec() executable command, , following arguments arguments command.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -