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

Vista - check printer driver if exists continue if not install

Reply
 
Old 08-05-2009   #1 (permalink)
Balgrath


 
 

check printer driver if exists continue if not install

Hi All,
With the help of many of you out there I have managed to create a script
that will;
1:create a TCP\IP port
2:Add the driver (via an inf file)
3: add the printer to the new port
4: set this as default

happy days and a big thanks to all of your guidance. I do however have an
additional request of you all. With this installation if the driver exists
on the machine I get a windows prompt to do with conflicts. sorry I dont have
the exact error.

my question so to speak is .. is there a way to determine IF the driver is
installed, if it is, use it IF NOT Install this driver and use it?

I currently am just copying the driver files to the local machine and
installing it regardless. obvioulsy the less the script has to do the better.

I am presuming that I can just butcher this section of script;
'adding the driver

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True

Set objDriver = objWMIService.Get("Win32_PrinterDriver")

objDriver.Name = "HP LaserJet M3035 MFP PCL 5"

objDriver.SupportedPlatform = "Windows NT x86"

objDriver.Version = "3"

objDriver.DriverPath = "C:\temp1\hp3035\hpz5r5io.dll"

objDriver.Infname = "C:\temp1\hp3035\hpc3035b.inf"

intResult = objDriver.AddPrinterDriver(objDriver)

toinclude the if \ then statement to gimme what I need?? Anyone got any
Ideas.

Cheers
Balgrath

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Old Hp printer deskjet 722C pls help me install a printer driver .NET General
How to check if a directory exists PowerShell
Can't install HP printer driver Vista print fax & scan
Check Designer can not install Capture Printer Driver Vista installation & setup
Upgrade Check incorrectly reports McAfee exists and cancels upgrad Vista installation & setup


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46