Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Brayden Smith   on Feb 04 In Java Category.

  
Question Answered By: Seth Anderson   on Feb 04

This is because "exec" looks for a program named "copy" and tries to execute it.

But there is no "copy.exe", (you can probably use xcopy.exe instead!).

Copy is one of the shell commands  that the shell handles itself.



For running shell commands, you should run "cmd" with /C param, and pass your command  .

For example, you should pass "cmd /C copy  d:\\music\\someFile.txt d:\\downloads" as the parameter for the exec method

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on copy with command prompt Or get search suggestion and latest updates.


Tagged: