Windows Vista Forums

Script to install a "HP 5Si Printer" as a local printer
  1. #1


    Tim Guest

    Script to install a "HP 5Si Printer" as a local printer

    OS: Windows XP

    I have found scripts to install network printers, but
    none to install local printers.



    I would also like to have this printer setup to print to file.

    Thanks for all comments.
    --
    Tim

      My System SpecsSystem Spec

  2. #2


    Richard Mueller [MVP] Guest

    Re: Script to install a "HP 5Si Printer" as a local printer

    Tim wrote:

    > OS: Windows XP
    >
    > I have found scripts to install network printers, but
    > none to install local printers.
    >
    > I would also like to have this printer setup to print to file.
    >
    One of these examples from the Script Center should help:

    http://www.microsoft.com/technet/scr.../prpovb04.mspx

    http://www.microsoft.com/technet/scr.../prpovb03.mspx

    --
    Richard Mueller
    MVP Directory Services
    Hilltop Lab - http://www.rlmueller.net
    --



      My System SpecsSystem Spec

  3. #3


    Tim Guest

    Re: Script to install a "HP 5Si Printer" as a local printer


    Thanks for the reply.
    I had already found this code and I couldn't get it to work.
    errResult returns a 0

    I can install ""HP LaserJet 5Si" manually without any problem.
    I want to perform the install via automation.

    Tim


    Option Explicit

    Call Main

    Sub Main
    Dim strComputer, objWMIService,objDriver, errResult
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

    Set objDriver = objWMIService.Get("Win32_PrinterDriver")
    objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True
    'objDriver.Name = "Apple LaserWriter 8500"
    objDriver.Name = "HP LaserJet 5Si"
    objDriver.SupportedPlatform = "Windows NT x86"
    objDriver.Version = "3"
    errResult = objDriver.AddPrinterDriver(objDriver)
    MsgBox errResult
    End Sub


    "Richard Mueller [MVP]" wrote:

    > Tim wrote:
    >

    > > OS: Windows XP
    > >
    > > I have found scripts to install network printers, but
    > > none to install local printers.
    > >
    > > I would also like to have this printer setup to print to file.
    > >
    >
    > One of these examples from the Script Center should help:
    >
    > http://www.microsoft.com/technet/scr.../prpovb04.mspx
    >
    > http://www.microsoft.com/technet/scr.../prpovb03.mspx
    >
    > --
    > Richard Mueller
    > MVP Directory Services
    > Hilltop Lab - http://www.rlmueller.net
    > --
    >
    >
    >

      My System SpecsSystem Spec

Script to install a "HP 5Si Printer" as a local printer problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Install network printer "manually" ? +Bob+ Server General 2 19 Jan 2010
"unable to install HP c5280 printer,error message 0x000003eb" Tanya1 Drivers 7 15 Dec 2009
Dell Laser Printer 3100cn "File Too Large" error barrybusey Vista print fax & scan 5 26 Sep 2008
A printer shared with "Net use LPT2 \\computer\printer /persistent:yes" command appears disconnect few minutes after last job Juan Carlos Vista networking & sharing 1 12 Dec 2007
"File and Printer sharing" firewall exception scope in Vista ? Vilius Vista networking & sharing 0 16 Jul 2007