Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Friday, May 15, 2020 9:59 PM
I first noticed this 3 or 4 months ago. I was not very worried then, but now it is becoming a real problem, since some applications that rely on the "print" command no longer work.
If you try to execute "print" with any file or even any text followed after it, the next error is displayed:
"Unable to initialize device PRN"
This command is broken for everyone I ask to try, regardless of setup and configuration.
Is there a way to make it work like before - to show up the printer selection dialog?
Is this a bug in Windows, or some settings are messed up?
NOTE: seems like it also happens on Windows Server 2016 and 2008.
- Windows repair/reinstall didn't help.
- I remember executing it successfully for a while. But now it's gone and I believe it happened after some update.
All replies (7)
Monday, May 18, 2020 2:26 AM
HI
1.how can I reproduce your issue ?
2.do you have a print script need to run ?
3."Is this a bug in Windows, or some settings are messed up? "
I think it not a bug .since I can not run print.exe in server 2019 .
Best Regards
Andy YOU
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Monday, May 18, 2020 10:40 AM
Hi Andy,
- To reproduce the issue just pass anything to the print command (not neccessarily an actual file), like this:
> print D:\test.txt
or just
> print 123
2. I can't provide you with the real thing, but in the end the application simply executes something like this:
system("print <file_path>");
Nothing special or complicated.
And before the problem, after that the printer selection dialog appeared.
The great thing about print.exe is that it checks the file type and automatically decides which print module to use (pdf, html, plain text, etc.).
3. Unfortunately, I can't access a Windows Server 2019 device. But in addition to the systems I've listed, it is also present even on the latest revision of Windows 7, which is reeeeeeally weird, because Win7 support ended before this issue appeared on Windows 10.
Tuesday, May 19, 2020 3:32 PM
...yes, it works OK if you specify a printer using /d: flag, but this topic is not quite about that
Thursday, May 21, 2020 10:46 AM
HI
"On Server 2008, print.exe fails when printing to Server 2008 print servers. Print.exe works to 2003 print servers or from 2003 systems to 2008 print servers. Error messages may be: "Unable to initialize device prn" (UAC off) "Unable to initialize device" (UAC on) Print.exe is currently incompatible with SMB 2.0. Since SMB 2.0 is only used when both computers communicating are 2008 or later, if either the client or server is 2003 or earlier, SMB 1.0 is used and print.exe works. A workaround is "type filename > \printserver\printer" I verified that general user can run Type command to print, it looks like current user do not have permission to open file Please check if you are able to run Type command to print other files which current user has permission."
SMB 2.0 can also be disabled on either the client or server to try to make print.exe function.
How to detect, enable and disable SMBv1, SMBv2, and SMBv3 in Windows
https://support.microsoft.com/en-us/kb/2696547
Best Regards
Andy YOU
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Thursday, May 21, 2020 3:51 PM
Thanks for the details, Andy. Now it’s becoming clearer to me what is happening.
To be able to mark a complete answer, could you please clarify a few more moments to me:
- Will there be a fix for print.exe?
- If I understand your workaround correctly, you mean redirecrion to a specific printer ("> \printserver\printer").
But is there a workaround to show the next printer selection dialog for a file:
^
This is how it worked before (by executing "print my_file"). And this is what I would like to return, ideally.
Thank you,
Oleksandr
Monday, May 25, 2020 2:50 PM
HI
4"But is there a workaround to show the next printer selection dialog for a file:"
what do you mean about this phrase ,could you please use pictures to explain it ?
5."If I understand your workaround correctly, you mean redirecrion to a specific printer ("> \printserver\printer")."
yes.
6"1) Will there be a fix for print.exe?"
SMB 2.0 can also be disabled on either the client or server to try to make print.exe function. How to detect, enable and disable SMBv1, SMBv2, and SMBv3 in Windows
https://support.microsoft.com/en-us/kb/2696547
Best Regards
Andy YOU
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Monday, May 25, 2020 5:11 PM
The picture was added by editing a couple of minutes after posting. Hmm, maybe some forum bug.
Anyway, here is the link to the picture: https://www.dummies.com/wp-content/uploads/483840.image0.jpg
I considered all the workarounds, but so far none are suitable.
Well, I will consider that no correction is planned:)
С/C++ dev