0

I am making POS which have comport printer. I created one text file and I want to give to the printer. I know the cmd command(print data.txt /d:com2) but how to give this command to CMD using java program?

1 Answers1

0

If you do not care about stdin/stdout, them just

Runtime.getRuntime().exec("print data.txt /d:com2").waitFor();
rustot
  • 331
  • 1
  • 11