Announcement

Collapse
No announcement yet.

Restoring printer settings with printui.dll

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Restoring printer settings with printui.dll

    Hello all,

    I have a problem restoring printer settings using printui.dll in windows command line shell. This document (damn, forum engine doesn't allow to post links to MS, but you can google there by using "Rundll32 printui.dll,PrintUIEntry site:microsoft.com" keywords), dated 2009, states, that described there command line parameters of printui.dll work on a dozen OSes, including Windows Server 2008 R2. This is not correct. I tested following command on several Windows Server 2008 R2 computers and it fails:

    rundll32 printui.dll,PrintUIEntry /Sr /n"Xerox Phaser blah-blah" /a%temp%\settings.dat

    with an error "unable to complete operation (0x0000000c)". Settings were previously stored with command:

    rundll32 printui.dll,PrintUIEntry /Ss /n"Xerox Phaser blah-blah" /a%temp%\settings.dat

    which went fine... Above commands usually work fine on x86-32 systems and fail in all tests on AMD64 systems. So, keeping in mind that Windows Server 2008 R2 is always AMD64 and this OS is included in "applies to" section, we have a problem here. The perfect solution would be managing to make above commands work on Windows Server 2008 R2 systems, as well as AMD64 Windows Sevens. Any suggestions?

    Anyone managed to get this done on AMD64 OSes?

  • #2
    Re: Restoring printer settings with printui.dll

    you cna't post links just yet as you're a new member.. I forget what the threshold is.. maybe 10 posts?

    you didn't export the settings from an X32 machine, to import on an x64 machine did you ?



    also, take a look at this, see if it might be useful for you:
    http://trycatch.be/blogs/roggenk/arc...olidation.aspx
    Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

    Comment


    • #3
      Re: Restoring printer settings with printui.dll

      Originally posted by tehcamel View Post
      you didn't export the settings from an X32 machine, to import on an x64 machine did you ?
      Of course I didn't, thanks for reply.

      You can test it yourself, simply use second command to store and first command to restore and it will fail on 64-bit OS.

      Looks like a buggy and untested software, but how could it be not tested on 64-bit, stating that it applies to, is beyond my comprehension.
      Last edited by gespenstern; 23rd November 2011, 07:06.

      Comment


      • #4
        Re: Restoring printer settings with printui.dll

        googlefu.
        http://support.microsoft.com/kb/2443101
        Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

        Comment


        • #5
          Re: Restoring printer settings with printui.dll

          thx!

          I googled alot, actually, it's strange how I wasn't able to find it

          Comment


          • #6
            Re: Restoring printer settings with printui.dll

            Even after applying the hotfix given by MS, am not able to restore the settings. I am trying in a win 2008 R2 64 bit server. Any other suggestions?

            Comment


            • #7
              Re: Restoring printer settings with printui.dll

              I'm having the same problem. I've been searching the internet for a week or two without finding a solution.

              So sorry dude, I can't help you. If you find a solution it would be great if you can share it.

              Comment


              • #8
                Re: Restoring printer settings with printui.dll

                Sure... i will let you know if i find any solution to it... I have been searching for a week with no solution yet...

                Comment


                • #9
                  Re: Restoring printer settings with printui.dll

                  Hello Petri forum guys, I see there are some who report MS patch not to be working. Here is what I investigated about printer settings and how to deploy them via command line.

                  Almost all printer settings are stored in registry in following key:

                  [HKEY_CURRENT_USER\Printers\DevModePerUser]

                  So, all you have to do to restore settings is to put in your group policy logon script a cmd file like this:

                  regedit /S \\server\share\a4-64.reg

                  where reg file is data exported from arorementioned key.

                  That way can be set such parameters as location, description, paper size, etc.

                  P.S. If I'm not mistaken, after applying above registry patch spooler service need to be restarted and this is quite tricky, because registry patch is applied in user environment and in most cases user doesn't have administrative rights to stop or start services. This could be avoided in putting in logon script some rights elevator with stored encrypted admin password, like runasspc and restarting spooler with admin priveleges, or, using GP to allow users to control spooler service and putting in logon script lines to restart spooler with user privileges. So whole script would be like this:

                  regedit /S \\server\share\a4-64.reg
                  net stop spooler
                  net start spooler

                  Furthermore, you can put in checks if settings are already applied using reg.exe command (which is unfortunately Windows 2000 incompatible, so beware if your network has them) to avoid reapplying registry patch and restarting spooler with every computer boot.
                  Last edited by gespenstern; 2nd December 2011, 07:47. Reason: extending comment

                  Comment


                  • #10
                    Re: Restoring printer settings with printui.dll

                    Great news. Do you mean that we have to export the registry and import it to the new server in order to get the printer settings? If thats the case and if the export/import is done in the same server means fine.

                    What if the Old server is win 2003 and new server is win 2008? How can we restore the printer settings?

                    Comment


                    • #11
                      Re: Restoring printer settings with printui.dll

                      Originally posted by Sessuinu View Post
                      What if the Old server is win 2003 and new server is win 2008? How can we restore the printer settings?
                      I checked variable %processor_architecture% and ran printuid.dll for 32-bit systems, restoring settings, stored on windows server 2003 32-bit computer. Targets were XPs, Vistas and Sevens, all 32-bit.

                      And I ran registry patch for all machines with %processor_architecture% == AMD64, those were Vistas, Sevens and 2008 R2s. Exported registry patch was prepared on a Windows Server 2008 R2 machine.

                      As far as I can tell all machines, that were targeted by this specific GPO, got desired settings of paper size, printer description and printer location.

                      Registry patch may differ for different processor architecture, or may not, I didn't check.

                      Comment


                      • #12
                        Re: Restoring printer settings with printui.dll

                        Also, I tested Microsoft patch and it works for Windows Server 2008 R2.

                        Comment

                        Working...
                        X