The documentation says that in /D:Printer parameter you need specify a PRINTER dispositive like LPT1,LPT2,LPT3,COM1,COM2,COM3,COM4 or network printer like \\ServerName\ShareName
But I found that you can specify a FILE on the printer.
This added a \0x0C character at the end of file.
Example:
Code: Select all
Echo.Hello>src.txt
Print /D:foo.out src.txt >NUL
notepad foo.out
or:
Code: Select all
Echo.Hello>src.txt
Print /D:MYFILE src.txt >NUL
notepad MYFILE
And this added a new utility feature: Added the \0x0C at the end of file and use \0x0C as character of end of file marker.
Also, create a file with the \0x0C character only:
Code: Select all
Type NUL > EMPTY.TXT
Print /D:CHAR.TXT EMPTY.TXT >NUL
Note:
If the the destination file exists print not overwrite the content, it not print to it. Is neccesary delete the destination file first.