My command is:
Runtime.getRuntime().exec("cmd /c copy /b D:\\MeAgent\\Reports\\receipt.hex lpt2:");
System.out.println("test");
In the console comes the "test", but the command is not executed and it comes no errormessage :(
My command is:
Runtime.getRuntime().exec("cmd /c copy /b D:\\MeAgent\\Reports\\receipt.hex lpt2:");
System.out.println("test");
In the console comes the "test", but the command is not executed and it comes no errormessage :(
Copyright © 2021 Jogjafile Inc.
Looks like you don't escape the last backslash.
Edit - now you've fixed the obvious
When you call exec you spawn a Process. You need to wait for that process to finish.
What you've got here is a race condition - i.e. your code is completing before the process executes.
http://docs.oracle.com/javase/1.7/docs/api/java/lang/Process.html