Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.


Go Back   Vista Forums > Misc Newsgroups > VB Script

RB

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

Reply
 
08-08-2009   #1
Tim


 
 

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
08-09-2009   #2
Richard Mueller [MVP]


 
 

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

Tim wrote:
Quote:

> 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
08-09-2009   #3
Tim


 
 

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:
Quote:

> Tim wrote:
>
Quote:

> > 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
Reply

RB


Thread Tools


Similar Threads for: Script to install a "HP 5Si Printer" as a local printer
Thread Forum
Dell Laser Printer 3100cn "File Too Large" error Vista print fax & scan
Reinstalling Printer No Longer Recognized as "New Hardware Found" Vista print fax & scan
A printer shared with "Net use LPT2 \\computer\printer /persistent:yes" command appears disconnect few minutes after last job Vista networking & sharing
"File and Printer sharing" firewall exception scope in Vista ? Vista networking & sharing
"Access Denied" Error Installing Shared Printer *FIX* Vista print fax & scan


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd