문제

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.

도움이 되었습니까?

해결책

pscp.exe is not in your path. You need to add it to your path or put in the command string the complete path to the pscp.exe executable.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top