none
Unable to share printer on Windows Web Server 2008 r2

    Question

  • Hello everybody.

     

    I am accessing remotely a machine running Windows Web Server 2008 R2. I logged as administrator. I added a printer in order to collect data from a database on MySQL by a TCP/IP connection.

    I tried to share this printer and the following error occured:

    "Printer settings could not be saved. Remote connections to the Print Spooler are blocked by a policy set on your machine."

    Then I tried the following:
    1) Typed gpedit.msc, clicked to run - Local group policy editor opened

    2) Entered the tree Computer Configuration -> Administrative Templates -> Printers

    3) Selected Allow Print Spooler to accept client connections. Edited and enabled.

    4) Restarted the machine

    This attempt didn`t solve my problem.

     

    I`m trying to print something from a MS_DOS command:

    PRINT /D:\\servername\printername "D:\folder\filename.txt"

    Error: Unable to initialize device \\servername\printername

     

    Then I tried:

    PRINT "D:\folder\filename.txt > printername

    No error has occured, however, I don`t get the file printed.

     

    If I open the .txt, click File -> Print, I get the data printed. So my problem is just occuring when I try to do that on MS-DOS.

    So far I have 2 hypothesis:
    1) The problem is due the impossibility of sharing the printer

    2) My script on MS-DOS is incorrect.

     

    Could someone give me suggestions about what to do ?

     

    Best regards,

     

    Marcelo

    Friday, May 06, 2011 4:46 PM

All replies

  • Printer sharing is not supported in Web Server. 

    In your case you should be able to pool the printer using LPT1 then print to LPT1 from the command line

    http://members.shaw.ca/bsanders/printfromdos.htm

    Step 2)a.

    the printer is a Local Printer and the print device is connected to a USB or some other kind of port (e.g. a Standard TCP/IP port). 

    In this case, you need to either:

    1. pool the port the printer is on with the LPT1 port (see Pool in Glossary) (thanks to Steven Latus for this suggestion)

    Alan Morris Windows Printing Team
    Friday, May 06, 2011 6:58 PM
    Answerer
  • Thanks for the answer

    I still have some questions

     

    I pooled the printer to LPT1 port.

    We run a software which collects data by a TCP/IP connection. The port is set as 22070. The printer I created is a virtual printer, also set as port 22070. So all data send to this printer will be collected by the software.

    There is no physival device connected on LPT1 port. Is that a problem ? The purpose of the virtual printer is just to allow the software to collect the data.

    Also, which command should I use now to print ?

    PRINT "D:\folder\filename.txt" > LPT1

     

    I would try it now, but I was disconnected from the machine in the exactly moment I was writing the command. Once I can access again, I`ll say the results.

     

    EDIT:

     

    Allright, I have access now, look what happened

    PRINT "D:\folder\filename.txt" > LPT1

    The system cannot find the file specified

     

    PRINT "D:\folder\filename.txt" /d:LPT1

    Unable to initialize device LPT1

     

    Any conclusion about this error ?

     

    Best regards,

     

    Marcelo


    Monday, May 09, 2011 6:42 PM
  • I had the same issue using a Hyper-V VM.  Is that your config?  Setting the pool to use COM2 worked in my case.

    I used

    copy filename COM2

    print.exe was changed by the networking team.  There is a blog on how it was depricated in Windows 7 but I'm not sure of the specifics.


    Alan Morris Windows Printing Team
    Wednesday, May 11, 2011 5:17 PM
    Answerer
  • It worked in a VM running Windows 2000 Professional, which I am using to make some tests too.

    However, it still doesn`t work in the machine running Windows Web Server 2008 R2.

    Thanks for the answer, Alan.

    Wednesday, May 11, 2011 6:18 PM
  • I had the same issue using a Hyper-V VM.  Is that your config?  Setting the pool to use COM2 worked in my case.

    I used

    copy filename COM2

    print.exe was changed by the networking team.  There is a blog on how it was depricated in Windows 7 but I'm not sure of the specifics.


    Alan Morris Windows Printing Team

    Hello Alan,

    I was still checking some solutions to my problem and then remembered your answer. You said you were using Hyper V. But is Hyper V available on Web version of Windoes Server 2008 R2 ?

     

    Regards,

     

    Marcelo

    Tuesday, May 17, 2011 2:28 PM
  • I do not know.  The COM2 scenario was a VM Standard Server configuration.  The Hyper-V host is running Server Enterprise.


    Alan Morris Windows Printing Team
    Tuesday, May 17, 2011 5:42 PM
    Answerer
  • If I suggest to the client to upgrade their OS to Standard or Enterprise version of Windows Server 2008 R2, do you think I would be able to share the printer (which I believe is the cause of the problem) ?

     

    Thank you,

     

    Marcelo

    Tuesday, May 17, 2011 5:51 PM