PC Review Forums Newsgroups Windows XP Windows XP WMI Problem with Win32_PrinterDriver

Reply

Problem with Win32_PrinterDriver

 
Thread Tools Rate Thread
Old 24-06-2004, 09:21 AM   #1
=?Utf-8?B?U3BhcnRhTWFu?=
Guest
 
Posts: n/a
Default Problem with Win32_PrinterDriver


Hello, I am having problems with the following Technet sample script when running on Windows XP :

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_PrinterDriver")
For each objPrinter in colInstalledPrinters
Wscript.Echo "Config File: " & objPrinter.ConfigFile
Wscript.Echo "Data File: " & objPrinter.DataFile
Wscript.Echo "Description: " & objPrinter.Description
Wscript.Echo "Driver Path: " & objPrinter.DriverPath
Wscript.Echo "File Path: " & objPrinter.FilePath
Wscript.Echo "Help File: " & objPrinter.HelpFile
Wscript.Echo "INF Name: " & objPrinter.InfName
Wscript.Echo "Monitor Name: " & objPrinter.MonitorName
Wscript.Echo "Name: " & objPrinter.Name
Wscript.Echo "OEMUrl: " & objPrinter.OEMUrl
Wscript.Echo "Supported Platform: " & objPrinter.SupportedPlatform
Wscript.Echo "Version: " & objPrinter.Version
Next

I am trying to retrive the objPrinter.InfName details for a manufacturer supplied printer driver, but the script always returns a null for this item.

The documentation on Win32_PrinterDriver suggests that the default for this item is ntprint.inf, but in the case of a manufacturer supplied driver, I was expecting to see a return of OEMnn.INF (where nn is a number allocated by the OS when the driver was originally installed).

Could someone explain whether my assumption is wrong or whether there is a problem with this WMI class ?


  Reply With Quote
Old 29-06-2004, 05:02 PM   #2
Alan Morris\(MSFT\)
Guest
 
Posts: n/a
Default Re: Problem with Win32_PrinterDriver

The inf field is IN only, used for installing a driver. You cannot retrieve
it.
--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto


This posting is provided "AS IS" with no warranties, and confers no rights.

"SpartaMan" <SpartaMan@discussions.microsoft.com> wrote in message
news:9AA11E1F-DAA7-40F7-AC2A-B8EFED6B1925@microsoft.com...
> Hello, I am having problems with the following Technet sample script when

running on Windows XP :
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> Set colInstalledPrinters = objWMIService.ExecQuery _
> ("Select * from Win32_PrinterDriver")
> For each objPrinter in colInstalledPrinters
> Wscript.Echo "Config File: " & objPrinter.ConfigFile
> Wscript.Echo "Data File: " & objPrinter.DataFile
> Wscript.Echo "Description: " & objPrinter.Description
> Wscript.Echo "Driver Path: " & objPrinter.DriverPath
> Wscript.Echo "File Path: " & objPrinter.FilePath
> Wscript.Echo "Help File: " & objPrinter.HelpFile
> Wscript.Echo "INF Name: " & objPrinter.InfName
> Wscript.Echo "Monitor Name: " & objPrinter.MonitorName
> Wscript.Echo "Name: " & objPrinter.Name
> Wscript.Echo "OEMUrl: " & objPrinter.OEMUrl
> Wscript.Echo "Supported Platform: " & objPrinter.SupportedPlatform
> Wscript.Echo "Version: " & objPrinter.Version
> Next
>
> I am trying to retrive the objPrinter.InfName details for a manufacturer

supplied printer driver, but the script always returns a null for this item.
>
> The documentation on Win32_PrinterDriver suggests that the default for

this item is ntprint.inf, but in the case of a manufacturer supplied driver,
I was expecting to see a return of OEMnn.INF (where nn is a number allocated
by the OS when the driver was originally installed).
>
> Could someone explain whether my assumption is wrong or whether there is a

problem with this WMI class ?
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off