I'm trying to run a.bat
file which is located here:
C:\A\B\C\D E\F
So I invoke:
cmd /c "cd C:\A\B\C\D E\F && a.bat"
on the CMD and I can see the execution of the file.
Now I want to run this file from Java
and then delete it, so I run:
Runtime.getRuntime().exec("cmd start /wait /c "+ "\"cd C:\\A\\B\\C\\D E\\F && a.bat\"");
(the /wait
because I want to delete the file only after its execution)
but I don't see the execution of the program (the CMD doesn't open). How can I fix this?