'PRINT label using CMD

I'm trying to send command to printer using windows cmd. It's kinda working but output from printer is just a blank page.

My command:

PRINT /D:\\PC_NAME\\PRINTER_NAME "C:\Users\XXXX\Desktop\MY_FILE.lbx"

// ... "C:\Users\XXXX\Desktop\MY_FILE.lbx is currently being printed"
// "printer": *starts printing*
// "printer": *blank page comes out 4x (4 TIMES! no idea why)*
// also my default printer properties is not working

The file is correct, when i press context menu on it, press "print" everything is working properly.

It's printer "P-Touch P950NW" for printing labels. Default properties are "chain printing" without cutting the paper after each printed file.


I also try the ShellExecute in python/c++, working good... but i can not specify the default printer and im afraid if someone have more than 1 printer, it will not work or print in bad one.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source