So here is the code, where the program runs but function is not being performed. Is it possible to copy a file in Java like this or should I use different method? If so, any references would be helpful.
import java.io.*;
import java.util.*;
import java.lang.*;
public class test
{
public static void main(String[] args)
{
String path = "cmd /C cd C:/xamppy/htdocs/fuzzy/includes/xxxxx";
String command = "cmd /C copy \"C:/xamppy/htdocs/fuzzy/includes/xxxxx/lifelesson.jpg\" \"C:/xamppy/htdocs/fuzzy/searcheditems\"";
try{
Runtime.getRuntime().exec(path);
Runtime.getRuntime().exec(command);
}
catch(IOException e)
{
System.out.println(e);
}
}
}