1. Open a text editor, such as Notepad.
2. If you are printing to a local printer using a USB port, replace ‘PrinterName' with the name of your printer. Do not replace ‘ComputerName' with the name of your computer. It will change dynamically when the batch file runs.
3. Net use LPT2: \\%ComputerName%\PrinterName
4. Copy %1 LPT2
5. Net use LPT2: /Delete