I have a printer shared on network, to which I am able to print from command line using
echo hello > \\PSNHP\PRN
or
copy /b hello.txt \\PSNHP\PRN
Idea from this link https://supportcommunity.zebra.com/s/article/Print-RAW-File-From-CMD?language=en_US
I like this because that way I do not need to install any driver on windows
I am trying to do the same from go
socket, err = os.OpenFile("\\\\"+comp+"\\PRN", os.O_WRONLY, os.ModeNamedPipe)
//or
socket, err = os.Open("\\\\"+comp+"\\PRN")
However, I am getting this error
open \\PSNHP\PRN: The system cannot find the file specified.
So, I am confused, is a network printer a file or not, how does the command prompt understand the stream redirection.
I think this question in c# has the same roots, I am not happy with the proposed answer, as I do not have direct network access to the printer Send text file directly to network printer