none
Windows can not connect to the printer 0x00000057

    Question

  • Hey Guys,

    I am  managing the HP printers through print server and all printers have been published through GP.But since last 3 months we have been facing a issue that some machines doesn't show any printer unless you don't add them through IP address and whenever we tried to add them using host name,error message says "Windows can not connect to the printer 0x00000057".

    We tried to unistall ,reinstall the universal HP driver but did not help.

    can someone help me out on this.i appreciate

     

    Thx

     

    Monday, June 06, 2011 3:42 PM

Answers

  • I figured out my situation.  Maybe it's yours. 

    It’s actually the print driver failing to install, not the connection to the print server.  An initial attempt to install the driver failed, so the driver directory is present on the workstation, but missing the files. 

    1)  On a machine with the same driver installed (and working properly), open Regedit, and browse to:
         HKLM\System\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3\
    2)  Locate the subkey for the printer driver you are dealing with and click the key for the printer driver.
    3)  Look for the “InfPath” on the right.  Note the path.
    5)  Now browse to C:\Windows\System32\DriverStore\FileRepository and locate the folder indicated in the InfPath reg value. 
    6)  Go to the users computer exhibiting this behavior, and browse to C:\Windows\System32\DriverStore\FileRepository and see if the folder is present.  In my case, the folder was present, but empty.  If it is here and it is empty, you will have to modify security on the folder, first taking over ownership, then granting yourself full control. 
    7)  Once security is granted, copy the contents of this folder from a good machine to the machine presenting the 0x00000057.

    Now try connecting to the print queue on the print server.  The driver should now download and install properly.

    Good luck.  This isn't the first time I've seen this happen, but this is the first time I decided a reimage was more than I wanted to take on, and I wanted to solve this so that I can correct it the next time it happens.  And I have yet to find a real solution to the 0x00000057 error code.

    Joel

    Friday, June 10, 2011 3:21 AM
  • Wow... I know it's an old thread but well worth adding to, as this was a highly ambiguous issue.

    I had the 0x00000057 error with a Xerox Workcentre 7535 Copier that I was installing in a domain Server 2008 R2/Win7Pro client setup. The printer drivers were installed on the server and worked for several other individuals. However, one individual was having problems installing the Xerox on his relatively new Windows 7 Pro 32-bit. We had an HP 1312 nfi Multifunction as well, which was shared on the 2008 R2 server. He had no problems installing the HP with the Universal PCL5 and PS drivers HP had on their site. So, when I tried installing the Xerox 7535 using the latest WHQL drivers offered by the Xerox site I got that 0x00000057 error.

    At first I thought it had something to do with the share being messed up so I reinstalled the x64 drivers and added x86 drivers to the server and that didn't work (Reboots of both the server and the client didn't help either). I then tried installing the driver locally and got the same error, which led me to believe it was a workstation issue.

    Ultimately the registry suggestion by Joe IT proved fruitless, in my case. However, I did check the ..\DriverStore\FileRepository folder and tried to look for some folders starting with X. There were only two and they did not look like xerox driver names. I asked a co-worker with Win7Pro that successfully installed the drivers to let me know if there were additional folders listed, and there were two xerox type driver folders that were missing off the problematic windows 7 system.

    I ended up putting the administrators group with full rights on the FileRepository folder (had to accept each subfolder as a failure due to no access permissions to change sub folder's permissions). Then I copied the 2 missing folders over to the "broken" system. I removed the admin group (and left the default Everyone and System accounts) permissions.

    I was then able to go to the server shares (Start > Run/Searchbox > \\server) and double clicked the Xerox printers which then successfully installed.

    Thanks for leading me in the right direction Joe IT. If it weren't for your suggestions I wouldn't have ever found this fix. I'm just curious how it ended up becoming an issue in the first place... :(

    • Proposed as answer by sniperdoc Tuesday, October 23, 2012 1:08 PM
    • Marked as answer by Guowen SuBanned Thursday, October 03, 2013 6:06 AM
    Tuesday, October 23, 2012 1:07 PM
  • This case have already close. :0)

    Guowen Su
    Cisco Certified Network Associate
    Cisco Certified Internetwork professional - MPLS
    Certified Information Systems Security Professional
    Microsoft Partner Network 2011
    Microsoft Certified Professional
    Microsoft Certified Systems Administrator:Security
    Microsoft Certified Systems Engineer: Security
    Microsoft Certified Technology Specialist: Windows Server 2008 Active Directory, Configuration
    Microsoft Certified Technology Specialist: Windows Server 2008 Network Infrastructure, Configuration
    Microsoft Certified Technology Specialist: Windows Server 2008 Applications Infrastructure, Configuration
    Microsoft Certified Technology Specialist: Windows 7, Configuring
    Microsoft Certified IT Professional: Enterprise Administrator
    Microsoft Certified IT Professional: Server Administrator
    Certified Ethical Hacker
    Computer Hacking Forensics Investigator
    Certified Sonicwall Security Administrator
    Microsoft Geeks

    Wednesday, October 02, 2013 6:11 AM

All replies

  • was your printer host name pingable ? in any case if you were to ping the ip address i believe you can get a reply but when u tried to lookup the hostname u face errors.. will that be DNS issues ?
    Guowen Su | CCNA, CCIP, MCP, MCSA, MCSE, MCTS, MCITP, CEH | http://www.microsoft.com/en/sg/default.aspx Our Goal? VERY SATISFIED Customers. If you're not...let's talk!! Please don't vote me for answers... because i do not want others to feels that i'm cheating ? :) In any case God knows :)
    Tuesday, June 07, 2011 3:58 AM
  • Yes....host name is  pingable.

    Tuesday, June 07, 2011 8:23 PM
  • I've got the same issue with the HP Universal Print Driver.  I'm using v5.2.  I tried creating a local printer on the users workstation and loading the driver and I still get the 0x00000057 error.  Can't find too much on this one.  Just trying to run HP's install.exe from the extracted driver set, I get:

    Printer driver was not installed.  Operation could not be completed (error 0x00000057).

    Going to Administrative Tools / Print Management / Print Servers / $Client PC$ / Drivers, then try adding the driver to the client PC.

    Unable to install HP Universal Printing PCL 5 (v5.2), Type 3 - User Mode, x86 driver.  Operation could not be completed (error 0x00000057).

    So, this tells me Windows Point and Print is not to blame here.  Something else going on in Windows 7.

    Joel

    Thursday, June 09, 2011 4:27 AM
  • I figured out my situation.  Maybe it's yours. 

    It’s actually the print driver failing to install, not the connection to the print server.  An initial attempt to install the driver failed, so the driver directory is present on the workstation, but missing the files. 

    1)  On a machine with the same driver installed (and working properly), open Regedit, and browse to:
         HKLM\System\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3\
    2)  Locate the subkey for the printer driver you are dealing with and click the key for the printer driver.
    3)  Look for the “InfPath” on the right.  Note the path.
    5)  Now browse to C:\Windows\System32\DriverStore\FileRepository and locate the folder indicated in the InfPath reg value. 
    6)  Go to the users computer exhibiting this behavior, and browse to C:\Windows\System32\DriverStore\FileRepository and see if the folder is present.  In my case, the folder was present, but empty.  If it is here and it is empty, you will have to modify security on the folder, first taking over ownership, then granting yourself full control. 
    7)  Once security is granted, copy the contents of this folder from a good machine to the machine presenting the 0x00000057.

    Now try connecting to the print queue on the print server.  The driver should now download and install properly.

    Good luck.  This isn't the first time I've seen this happen, but this is the first time I decided a reimage was more than I wanted to take on, and I wanted to solve this so that I can correct it the next time it happens.  And I have yet to find a real solution to the 0x00000057 error code.

    Joel

    Friday, June 10, 2011 3:21 AM
  • Great man,it worked...........

    Thankyou so much to sharing these steps with me.

    Friday, June 10, 2011 7:37 PM
  • No problem.  So you had an empty driverstore directorytoo?  Why didn't 0x00000057 produce any hits related to that?  I'm glad this made sense!  It wasn't easy to write up, and I hope a home user never reads that and tries it!

    One thing I notice about adding printers in Windows 7, you can select multiple printers from a print server and install them all at once, but I think this is where the driver can get corrupt like this.  I've changed my habbit to adding them by going \\printserver, then clicking "View Remote Printers", selecting multiple printers, then right click and select "Connect".  This seems to connect to them one by one, allowing the print driver to download and install before a whole pile of printers try to download and install it all at the same time.  I'm guessing deploying printers with a GPO tries to add them all at once.  I was using a deployment tool with seperate packages for every printer in my environment.  I'm moving all our printers from one print server to another, so the package looks to a registry key for the presence of a network printer on the old print server, if that condition is met, it moves on to running to the following command to delete the printer:
    C:\Windows\System32\rundll32.exe" printui.dll,PrintUIEntry /dn /n \\OldServer\Printer
    Then run this command to install the printer from the new print server:
    C:\Windows\System32\rundll32.exe" printui.dll,PrintUIEntry /in /n \\NewServer\Printer

    I ended up modifying to wait for this to run before moving on.  Otherwise, the deployment would pop up several printer installation windows at once and cause issues. 

    Joel

    Friday, June 10, 2011 11:29 PM
  • Thanks, that really helped me out.

    I too had a problem with the HP Universal Driver, but my folder wasn't empty. It was full of files from the old Universal driver, but my print server had deleted that and replaced it with a later Universal driver.

    In the end I had to take control of the appropriate FileRepository folder (and give myself full control), delete the old folder and copy the new folder from a working PC.

    Thursday, August 11, 2011 11:33 AM
  • Hey Guys,

    I am  managing the HP printers through print server and all printers have been published through GP.But since last 3 months we have been facing a issue that some machines doesn't show any printer unless you don't add them through IP address and whenever we tried to add them using host name,error message says "Windows can not connect to the printer 0x00000057".

    We tried to unistall ,reinstall the universal HP driver but did not help.

    can someone help me out on this.i appreciate

     

    Thx

    Hello friend!

    It may happen that the drivers have become old due to which the problem occurred. There are many sites available that you can search to get the free driver download.   


    Saturday, February 04, 2012 11:45 AM
  • Very helpful solution by Joe IT, thanks for that (after changing to GPO deployment of printer drivers in context with changing to a new print server 6 out of 150 machines developed the error 0x000005b3 for driver installation). Tried a lot of different solutions - and finally this was the only one, which helped.

    The error 0x00000057 came up after deleting the corrupted folder in FileRepository.

    After copying back the appropriate folder from a working machine, the driver finally installed, in case of the HP Universal Printer driver it was c:\Windows\System32\DriverStore\FileRepository\hpcu115c.inf_x86_neutral_89c704d2fef0ef48.

    Best greetings from Germany
    Olaf

    Thursday, February 09, 2012 12:57 PM
  • Thanks Joe, you just saved me from having to reimage a machine.  This solution worked perfectly!
    Thursday, March 29, 2012 3:00 AM
  • Worked for me! Thank you Joe!
    Monday, May 14, 2012 9:30 AM
  • If I have a 2008 server x64 and the folder FileRepository don't exist - Should I put it there. May
    Wednesday, July 11, 2012 8:41 AM
  • Great Job Joe.   I was getting so pissed off that i was about to rebuild the server, this fix saved me a couple of hours of work.
    Wednesday, September 12, 2012 2:48 PM
  • I had this problem when I switched several printer queues from HP UPD PCL5 (v5.1) and (v5.4) to (v5.5.0).  There doesn't appear to be any pattern as to who has this error and who does not - something on the order of 5-15% of workstations have been impacted (WIN7 64-bit machines, print servers are Server 2008 R2 64-bit).

    Checking under \driverstore\filerepository generally shows that the appropriate subfolder where the driver files should be is either partially or completely empty, and in a few instances the subfolder was not there at all.  This means that on most of the machines which fail to completely copy the driver files down from the server, they are copying at least *some* of the driver files.  Permissions appear to be set properly - \filerepository and subfolders are consistent.

    Does anyone know what the root cause may be?  Has anyone opened a case with MS on this issue?  I checked with our HP technical rep and this doesn't ring any bells with them.  While I can work around it on an individual basis (take ownership of driver folder, give myself permissions, manually copy the files there) this is certainly not acceptable for widescale use.  I never had this problem previously (queues having drivers changed, sometimes multiple times, with HP UPD PCL5/PS, v5.1 and v5.4 in play).

    Wednesday, September 19, 2012 10:14 PM
  • How are you deploying your printers?  Group Policy?  Script?  If script, you can wait between adding printers.  If GP, I don't know how you can prevent multiple printers from installing all at the same time, steping all over the drivers folder it's pulling down from the server. 
    Wednesday, September 19, 2012 10:41 PM
  • Hi Joe,

    Users map to printers as needed (via add printer wizard, or start \\[servername]\[printername]).

    Wednesday, September 19, 2012 11:18 PM
  • For us, it happened when I was deploying printer via script, and when IT staff would go to \\printserver, select multiple printers, then click Open.  We haven't had another instance of this since I changed the script to wait until each printer install is complete and instructing our IT staff to go to \\printserver, select "View Remote Printers", select all the printers they need to install on a users computer, then right click and select "Connect".  This seems to do it in an orderly fashion - one by one until all printers are added.  For whatever reason, Windows 7 wants to try to pull all printers down at once and cause the issue.  As far as talking to MS about the issue, I haven't opened a ticket.  We're too small a shop to get noticed.  Just knowing how to avoid the issue has helped us.  We haven't had to reimage a workstation or do my fix since learning to make sure printers install one by one.
    Wednesday, September 19, 2012 11:32 PM
  • HP recommended to me that when I want to update printer drivers on a server I should delete and recreate the printer queue...not a practical approach with hundreds of queues, and it hasn't been necessary before.

    Since drivers were updated on existing queues they should push transparently to user workstations if someone is already mapped to one of those queues.  This appears to work fine in the majority of cases but not all, and unless some folks haven't been printing for days at a time (unlikely) it becomes a problem for some folks much later (e.g. days after driver on their printer was changed).

    I guess I will contact MS and get a case started on this, we'll see what light they can shed.

    Wednesday, September 19, 2012 11:54 PM
  • i tried the method mentioned above. on a machine the printer is working on; i look for the key that contains the infpath, but its blank? how would this printer be working then?
    Monday, September 24, 2012 5:57 PM
  • I figured out my situation.  Maybe it's yours. 

    It’s actually the print driver failing to install, not the connection to the print server.  An initial attempt to install the driver failed, so the driver directory is present on the workstation, but missing the files. 

    1)  On a machine with the same driver installed (and working properly), open Regedit, and browse to:
         HKLM\System\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3\
    2)  Locate the subkey for the printer driver you are dealing with and click the key for the printer driver.
    3)  Look for the “InfPath” on the right.  Note the path.
    5)  Now browse to C:\Windows\System32\DriverStore\FileRepository and locate the folder indicated in the InfPath reg value. 
    6)  Go to the users computer exhibiting this behavior, and browse to C:\Windows\System32\DriverStore\FileRepository and see if the folder is present.  In my case, the folder was present, but empty.  If it is here and it is empty, you will have to modify security on the folder, first taking over ownership, then granting yourself full control. 
    7)  Once security is granted, copy the contents of this folder from a good machine to the machine presenting the 0x00000057.

    Now try connecting to the print queue on the print server.  The driver should now download and install properly.

    Good luck.  This isn't the first time I've seen this happen, but this is the first time I decided a reimage was more than I wanted to take on, and I wanted to solve this so that I can correct it the next time it happens.  And I have yet to find a real solution to the 0x00000057 error code.

    Joel

    So my laptop is getting this error too, my printer used to work.. I don't know what happened. Anyway, at step 6 I went to that folder and there is stuff in it, it isn't empty... what should I do then? I still can't seem to get the drivers to install

    • Proposed as answer by thai land Monday, October 01, 2012 5:50 PM
    • Unproposed as answer by thai land Monday, October 01, 2012 6:09 PM
    Sunday, September 30, 2012 8:58 PM
  • if you have access to another machine with the same OS; try installing the driver on the second computer then take ownership of it like in the steps above. copy the desired driver folder from C:\Windows\System32\DriverStore\FileRepository then paste it on your computer in the same location making sure to overwrite the old files. then in the registry make sure the infPath key is pointing to the correct .inf file. i had to do this because i had an older version of a print driver installed than the one used on our print server. i could not get the driver uninstalled by normal means so i just copied the files for the new driver and put them where the old ones were. worked like a charm.
    • Proposed as answer by thai land Monday, October 01, 2012 5:53 PM
    Monday, October 01, 2012 2:16 PM
  • if you have access to another machine with the same OS; try installing the driver on the second computer then take ownership of it like in the steps above. copy the desired driver folder from C:\Windows\System32\DriverStore\FileRepository then paste it on your computer in the same location making sure to overwrite the old files. then in the registry make sure the infPath key is pointing to the correct .inf file. i had to do this because i had an older version of a print driver installed than the one used on our print server. i could not get the driver uninstalled by normal means so i just copied the files for the new driver and put them where the old ones were. worked like a charm.


    • Edited by thai land Monday, October 01, 2012 5:54 PM
    Monday, October 01, 2012 5:53 PM
  • if you have access to another machine with the same OS; try installing the driver on the second computer then take ownership of it like in the steps above. copy the desired driver folder from C:\Windows\System32\DriverStore\FileRepository then paste it on your computer in the same location making sure to overwrite the old files. then in the registry make sure the infPath key is pointing to the correct .inf file. i had to do this because i had an older version of a print driver installed than the one used on our print server. i could not get the driver uninstalled by normal means so i just copied the files for the new driver and put them where the old ones were. worked like a charm.





    • Edited by thai land Monday, October 01, 2012 5:59 PM
    Monday, October 01, 2012 5:54 PM
  • Wow... I know it's an old thread but well worth adding to, as this was a highly ambiguous issue.

    I had the 0x00000057 error with a Xerox Workcentre 7535 Copier that I was installing in a domain Server 2008 R2/Win7Pro client setup. The printer drivers were installed on the server and worked for several other individuals. However, one individual was having problems installing the Xerox on his relatively new Windows 7 Pro 32-bit. We had an HP 1312 nfi Multifunction as well, which was shared on the 2008 R2 server. He had no problems installing the HP with the Universal PCL5 and PS drivers HP had on their site. So, when I tried installing the Xerox 7535 using the latest WHQL drivers offered by the Xerox site I got that 0x00000057 error.

    At first I thought it had something to do with the share being messed up so I reinstalled the x64 drivers and added x86 drivers to the server and that didn't work (Reboots of both the server and the client didn't help either). I then tried installing the driver locally and got the same error, which led me to believe it was a workstation issue.

    Ultimately the registry suggestion by Joe IT proved fruitless, in my case. However, I did check the ..\DriverStore\FileRepository folder and tried to look for some folders starting with X. There were only two and they did not look like xerox driver names. I asked a co-worker with Win7Pro that successfully installed the drivers to let me know if there were additional folders listed, and there were two xerox type driver folders that were missing off the problematic windows 7 system.

    I ended up putting the administrators group with full rights on the FileRepository folder (had to accept each subfolder as a failure due to no access permissions to change sub folder's permissions). Then I copied the 2 missing folders over to the "broken" system. I removed the admin group (and left the default Everyone and System accounts) permissions.

    I was then able to go to the server shares (Start > Run/Searchbox > \\server) and double clicked the Xerox printers which then successfully installed.

    Thanks for leading me in the right direction Joe IT. If it weren't for your suggestions I wouldn't have ever found this fix. I'm just curious how it ended up becoming an issue in the first place... :(

    • Proposed as answer by sniperdoc Tuesday, October 23, 2012 1:08 PM
    • Marked as answer by Guowen SuBanned Thursday, October 03, 2013 6:06 AM
    Tuesday, October 23, 2012 1:07 PM
  • can anyone help with my issue?

    it'similar but i don't have anther pc to copy any info from

    also i can't upload a image as it's asking to verify my account.. how? no help anywhere

    Wednesday, October 24, 2012 7:57 PM
  • So apparently this is a huge problem with the deployment of printers. IF the printer driver does not pre-exist in the C:\Windows\System32\DriverStore\FileRepository THEN windows will NOT install a server shared driver?

    What happened to automatically downloading the driver from the printservers \\printserver\print$ like with Vista and Windows XP?

    Print drivers get updated all the time and if the driver on the print server is NEWER than the FileRepository then the printer won't add even with an administrator. It entirely breaks Point and Print. It means in domains that printers have to be published in packages and deployed before users or administrators can add them.

    I can't determine when this issue was created with what "update" but it happens on ALL my workstations on different domains even those not connected to the domain. It is not group policy.


    lforbes


    • Edited by lforbes Thursday, February 21, 2013 6:59 PM
    Thursday, February 21, 2013 5:51 PM
  • So an update on this on the "fix" which really isn't a fix at all.

    If you take ownership of the C:\Windows\System32\DriverStore folder, set Admins=Full Control and delete the .dat files in there and then restart the print service, you can add printers as an administrator.

    Basically this defeats the entire purpose of point to print and adding printers under the SYSTEM account.


    lforbes

    Friday, February 22, 2013 12:35 AM
  • This solution fixed my Windows 8 Home Share printer sharing problem as well. I wish there was an easier way to fix the issue though. It should be a Kbase article and the error message is so misleading.

    Thank you Joe IT!

    Friday, March 08, 2013 5:43 AM
  • There is a faster and easier way. Printui.exe is a command added with Windows 7. You need to delete the driver packages from the computer entirely using this and then you can re-add. The fastest way is to delete the printer in the cue. Then at admin command prompt type printui.exe /s /t2 this gives you the printer advanced properties with the packages installed. Delete driver and package. Note you may get driver in use when you try to delete. Stopping and starting the spooler can help. If not you can kill the registry keys that are holding it. This is the kb Article with the key. http://support.microsoft.com/kb/2771931

    lforbes

    • Proposed as answer by lforbes Friday, March 08, 2013 2:59 PM
    Friday, March 08, 2013 2:58 PM
  • I tackled this a different way. Got the '57' error when trying to install a Konica Minolta printer that was shared from a Windows server. Adding a printer worked up to the point of downloading a driver and then the '57' error appeared.

    I fixed this by getting the latest driver from the KM web site and then installing on the client machine as a local printer. Obviously I couldn't print to the printer at this point but I knew the driver was installed. I then went to another client machine that could print properly to the KM and checked the printer properties for the Port it was using. I clicked on configure port and made a note of all the settings. Went back to the problem client and created the Port manually. Selected this and voila! All is working.

    Tuesday, April 23, 2013 11:16 AM
  • Okay, so I think I may have found the problem and a solution to it.

    Problem: I use printui.dll,PrintUIEntry called with RUNDLL32. When trying to automate a script to install a networked printer for all users I ran into the 0x00000057 error over and over again. I found out that the issue was when I tried installing the printer per machine with "/ga" and adding it as a per machine network printer connection "/in" (see script below). 

    Solution: The solution to this was to remove the line with "/in". I believe the issue was that the printer that I was trying to connect to already had a 'per machine' connection to the computer because of the "/ga" line. Therefore when I used the "/in" line it resulted in an error because the printer port was already connected. For those of you that have the problem you can use ["RUNDLL32 PRINTUI.DLL,PrintUIEntry /ge /c \\%COMPUTERNAME% /n "\\SERVER_NAME\PRINTER_PORT_NAME"] to enumerate any existing connections and using the same command with the "/gd" instead of "/ge" switch to remove it. This should fix your problem. The script below accounts for that by removing any traces of the specified printer before installing it. 

    Please post if this doesn't work so we can all know the issue(s) that causes it! Also, be sure you're using the Printers' port name if you're adding it from a server otherwise the printer will not be added and the command will display an error.

    It took me quite a while to get this script working %100 so I hope you can find it useful. Some credit goes to Rob Vander Woude's site which helped me out with the syntax. I use this as part of my SetupComplete.cmd  to install my printers after joining the domain with netdom.exe by calling it with psexec.exe and domain\user credentials. This way you can add a shared printer without rebooting to 'fully' join the domain. You can also query the parent OU of the computer if you have dsquery.exe (and the .mui file in System32\en-US of course) to figure out what printers should be installed via the second script below. The OU query script does set the parent OU as a global variable with setx.exe - be sure that isn't sensitive information in your environment.

    --------------Printer add script---------

    SET PRINTER_PORT_NAME=Print1
    SET SERVER_NAME=ComputerSharingPrinter
    rem SET SET_DEFAULT=YES
    ::
    ::
    SET temp_FILE="C:\temp.txt"

    REM Try to get the printer settings into a file
    RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xg /Gw /n "\\%SERVER_NAME%\%PRINTER_PORT_NAME%" /f "%temp_FILE%" /q
    REM First 4 lines remove printer - Other lines add printer for all users and install the driver
    echo install 
    IF EXIST %temp_FILE% (
    echo Clean up for %PRINTER_PORT_NAME%
    RUNDLL32 PRINTUI.DLL,PrintUIEntry /dl /Gw /c \\%COMPUTERNAME% /n "\\%SERVER_NAME%\%PRINTER_PORT_NAME%"  /j"LanMan Print Services" /q

    REM The line below removes the existing connection with your specified printer with "/dn"

    RUNDLL32 PRINTUI.DLL,PrintUIEntry /dn /Gw /c\\%COMPUTERNAME% /n "\\%SERVER_NAME%\%PRINTER_PORT_NAME%"  /j"LanMan Print Services" /q
    RUNDLL32 PRINTUI.DLL,PrintUIEntry /dd /Gw /c\\%COMPUTERNAME% /n "\\%SERVER_NAME%\%PRINTER_PORT_NAME%"  /j"LanMan Print Services" /q
    RUNDLL32 PRINTUI.DLL,PrintUIEntry /gd /Gw /c\\%COMPUTERNAME% /n "\\%SERVER_NAME%\%PRINTER_PORT_NAME%"  /j"LanMan Print Services" /q
    net stop Spooler
    net start Spooler
    echo Install %PRINTER_PORT_NAME%
    RUNDLL32 PRINTUI.DLL,PrintUIEntry /ga /Gw /c\\%COMPUTERNAME% /n "\\%SERVER_NAME%\%PRINTER_PORT_NAME%" /j"LanMan Print Services" /q

    REM The line below would add the network printer connection per machine - this is not needed since the printer is added in the above line with "/ga"

    REM RUNDLL32 PRINTUI.DLL,PrintUIEntry /in /Gw /c\\%COMPUTERNAME% /n "\\%SERVER_NAME%\%PRINTER_PORT_NAME%" /j"LanMan Print Services" /q

    IF DEFINED SET_DEFAULT RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "\\%SERVER_NAME%\%PRINTER_PORT_NAME%" /q
     ) ELSE (
    echo Connection to "\\%SERVER_NAME%\%PRINTER_PORT_NAME%" not available

     )
    DEL /F /Q %temp_FILE%>NUL
    net stop Spooler
    net start Spooler
    rem echo DONE
    ENDLOCAL

    ----------------------------------

    ----------Parent OU Script------------

    SETLOCAL ENABLEDELAYEDEXPANSION
    @echo off
    IF EXIST C:\Windows\System32\dsquery.exe (
    FOR /f "tokens=4 delims==," %%a in ('dsquery computer DC^=intra^,DC^=ecu^,DC^=edu -name %COMPUTERNAME%') do set _PARENT_OU=%%a
     ) ELSE (
    set _PARENT_OU=PARENT_OU_NOT_SET
     )
    IF NOT "%_PARENT_OU%"=="" (
    SETX __PARENT_OU_ %_PARENT_OU% /m
    echo %_PARENT_OU%>%SYSTEMROOT%\TEMP_OU.TXT
     ) ELSE (
    set _PARENT_OU=PARENT_OU_NOT_SET
    echo %_PARENT_OU%>%SYSTEMROOT%\TEMP_OU.TXT
     )

    ENDLOCAL

    ---------------------------------------

    Hope these work well for everyone..

    Udeck


    EDIT: If you are trying to connect to a printer that is shared from a different architecture, you will encounter this same error. So, make sure the host and client are the same architecture otherwise this will not work. 
    Friday, June 14, 2013 8:04 PM
  • Hi JoeIT - it's July 2013 and your fix STILL worked on this pesky problem.  My drivers were of the 64-bit variety, but that was my only adjustment.  Worked like a charm!  Thanks for doing all the dirty work for us.  This is going into our "How To" library.

    Al


    • Edited by EndoTechno Thursday, July 18, 2013 6:11 PM kudos
    Thursday, July 18, 2013 6:11 PM
  • remove complete printer software from computer and remove printer device from control panel right click on printer device and remove device, reboot computer, after reboot if you have printer software disc with you, insert the disc into computer and install printer software, after installing printer software add printer device in control printers, add device if it is wireless it would detect by computer.

    Note: You can go to control printer via hold windows button and press R, run window will open and type control printers.

    Tuesday, October 01, 2013 5:01 AM
  • This case have already close. :0)

    Guowen Su
    Cisco Certified Network Associate
    Cisco Certified Internetwork professional - MPLS
    Certified Information Systems Security Professional
    Microsoft Partner Network 2011
    Microsoft Certified Professional
    Microsoft Certified Systems Administrator:Security
    Microsoft Certified Systems Engineer: Security
    Microsoft Certified Technology Specialist: Windows Server 2008 Active Directory, Configuration
    Microsoft Certified Technology Specialist: Windows Server 2008 Network Infrastructure, Configuration
    Microsoft Certified Technology Specialist: Windows Server 2008 Applications Infrastructure, Configuration
    Microsoft Certified Technology Specialist: Windows 7, Configuring
    Microsoft Certified IT Professional: Enterprise Administrator
    Microsoft Certified IT Professional: Server Administrator
    Certified Ethical Hacker
    Computer Hacking Forensics Investigator
    Certified Sonicwall Security Administrator
    Microsoft Geeks

    Wednesday, October 02, 2013 6:11 AM
  • Thanks Joel, after 3 hours of troubleshooting I came across your post, I applied the solutions and it worked!
    Friday, December 13, 2013 8:41 PM
  • I did the same thing, Its working fine now.

    Sunday, February 09, 2014 8:04 AM
  • Better to use pnputil (if you truly want the driver uninstalled) Remember to start CMD as Administrator.
    Microsoft PnP Utility
    Usage:
    ------
    pnputil.exe [-f | -i] [ -? | -a | -d | -e ] <INF name> 
    Examples:
    pnputil.exe -a a:\usbcam\USBCAM.INF      -> Add package specified by USBCAM.INF
    pnputil.exe -a c:\drivers\*.inf          -> Add all packages in c:\drivers\
    pnputil.exe -i -a a:\usbcam\USBCAM.INF   -> Add and install driver package
    pnputil.exe -e                           -> Enumerate all 3rd party packages
    pnputil.exe -d oem0.inf                  -> Delete package oem0.inf
    pnputil.exe -f -d oem0.inf               -> Force delete package oem0.inf
    pnputil.exe -?                           -> This usage screen

    - First create a list of installed 3rd party drivers with this command (creates a file on the desktop)
    pnputil -e >%userprofile%\desktop\pnputil.txt

    - Now sort thrue the list and see what drivers you wan to remove and use this command
    pnputil -d oem#.inf

    Note: most times its necessary to use -f switch to force delete the driver
    pnputil -f -d oem#.inf
    Wednesday, April 23, 2014 9:17 AM
  • The same issue I faced and it get it resolved by following steps mentioned here:

    I have 2 win-7 (64 bit) PCs, One is fine and installs printer without errors. Other PC gives me 0x00000057 error. I have Xerox printer with universal driver installed on Server (Win 2008).

    I just checked for the folders in C:\Windows\System32\DriverStore\FileRepository starting with 'x' (for Xerox) in OK PC and compared the same on Problematic PC. Need to copy only one folder like 'x...amd64...'

    Then try to connect the printer..  and its done..  Thanks 'sniperdoc' and 'JoeIT'

     
    Thursday, April 24, 2014 2:50 PM
  • I know this is an old thread but I wanted to add my input.

    Unfortunately Joels fix of checking the folder exists in  C:\Windows\System32\DriverStore\FileRepository

    did not work for me but I did manage to fix it by doing the following from the client computer

    1. Start>Run>MMC

    2. File> Add/Remove Snap-in>Select Print Management> Click Add local server> Finish> OK

    3. Expand Print Server> Local Server> Click Drivers

    4. Locate the driver you are having issues with and delete it.

    5. Reinstall printer and this should now work.

    12 minutes ago