I have some problem about run windows cmd ,when I run my code on GEL or some java tool,it works,but it run error that windows can't find "pscp".However,I export execute jar from eclipse and java -jar ..It works!! I set pscp path first, so i can type pscp commend on cmd.
String file="test5.pdf";
String Ip="140.118.175.196";
String commend="cmd.exe /c start pscp.exe d://"+file+" admin@"+Ip+":/home/admin/test";
Process ee = Runtime.getRuntime().exec(commend);
What happen? Thanks.
Copyright Notice:Content Author:「louis」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/19997130/java-run-cmd-commands