IT Management Suite

  • 1.  can't run rundll32 printui,PrintUIEntry /ia or /Sr as a System Altiris script

    Posted Jul 23, 2010 04:15 PM


    I'm trying to install a print driver and print settings with printui.dll, but it won't work as an Altiris script in windows 7.  Is there any workaround?

    rem click 'install' for unsigned driver
    start autoit kyocera.au3
    rundll32 printui.dll,PrintUIEntry /ia /m "Kyocera FS-9530DN KX" /h "x64" /v "Type 3 - User Mode" /f "Kyocera FS-9530DN KX\OEMSETUP.INF"

    rem set to 'pcl 5e' under devices, pdl
    rundll32 printui.dll,PrintUIEntry /Sr /n printer1 /a printer1.dat d



  • 2.  RE: can't run rundll32 printui,PrintUIEntry /ia or /Sr as a System Altiris script

    Posted Jul 26, 2010 11:00 AM
    Make sure the account specified in the Client Run environment has proper permissions. Are you running the x32 or x64 of Windows 7? Is this for a local or networked printer, and if networked, is it connected to a printer server or just an IP port?

    I use the script below for clients that have printers connected to a print server.
    set objNetwork = WScript.CreateObject("WScript.Network")
    set objShell = WScript.CreateObject("WScript.Shell")

    'Add Network printers
    objNetwork.AddWindowsPrinterConnection \\server\printer
    objNetwork.AddWindowsPrinterConnection \\server\printer

    'Set Default Printer
    objNetwork.SetDefaultPrinter \\server\printer

    'Attrib to system, hidden and read only
    objShell.Run("attrib %systemroot%\printers.vbs +r +s +h")


  • 3.  RE: can't run rundll32 printui,PrintUIEntry /ia or /Sr as a System Altiris script

    Posted Jul 26, 2010 02:51 PM

    Thanks for the reply.  It's definitely running as System, and 64-bit windows 7.  That doesn't mean the System account has the same HKEY_CURRENT_USER registry items as other accounts.  These are remote windows lpr queues.  I'm creating the printers using the vbscripts under c:\windows\system32\printing_admin_scripts\.  (These scripts don't do devmode or printerdata settings.)

    prnport.vbs -a -r port1 -h server1 -o lpr -q queue1
    prndrvr.vbs -a -m "Kyocera FS-9530DN KX" -v 3 -e "Windows x64" -i "Kyocera FS-9530DN KX\oemsetup.inf"
    prnmngr.vbs -a -p printer1 -m "Kyocera FS-9530DN KX" -r port1

    This is also an unsigned driver.  Bleh.  (I'm running autoit before this just to click 'install anyway'.)

    Of course prnadmin.dll doesn't work at all...




  • 4.  RE: can't run rundll32 printui,PrintUIEntry /ia or /Sr as a System Altiris script

    Posted Jul 26, 2010 06:27 PM
    Actually, now it looks like System doesn't have enough privileges:

    prnmngr -a -p printer1 -m "Kyocera FS-9530DN KX" -r port1
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    Unable to add printer printer1 Error 0x80041003 Access denied
    Operation PutInstance
    Provider Win32 Provider
    Description Access is denied.
    Win32 error code 5

    This works fine with a user in the administrators group.

    EDIT:
    Nevermind.  The prnmngr command works as System in Session 0 (through Altiris in the hidden window), just not in Session 1 (the regular user window).  The PrintUIEntry way to install an unsigned printer driver works as System in Session 1, but errors out in Session 0.