by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Thu 29th July 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Get the installed printer driver details using Win32_PrinterDriver WMI Class
'Generated using 'WMI Win32 Class Autoscript Generator' - Developed by Karthikeyan
'Homepage: http://www.geocities.com/marskarthik
On Error Resume Next
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\Win32_PrinterDriver.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_PrinterDriver Class by Karthikeyan"
TextFile.WriteLine
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_PrinterDriver",,48)
For Each SubItems in Items
TextFile.WriteLine "********************************************************************"
TextFile.WriteLine "Caption: " & SubItems.Caption
TextFile.WriteLine "ConfigFile: " & SubItems.ConfigFile
TextFile.WriteLine "CreationClassName: " & SubItems.CreationClassName
TextFile.WriteLine "DataFile: " & SubItems.DataFile
TextFile.WriteLine "DefaultDataType: " & SubItems.DefaultDataType
TextFile.WriteLine "DependentFiles: " & SubItems.DependentFiles
TextFile.WriteLine "Description: " & SubItems.Description
TextFile.WriteLine "DriverPath: " & SubItems.DriverPath
TextFile.WriteLine "FilePath: " & SubItems.FilePath
TextFile.WriteLine "HelpFile: " & SubItems.HelpFile
TextFile.WriteLine "InfName: " & SubItems.InfName
TextFile.WriteLine "InstallDate: " & SubItems.InstallDate
TextFile.WriteLine "MonitorName: " & SubItems.MonitorName
TextFile.WriteLine "Name: " & SubItems.Name
TextFile.WriteLine "OEMUrl: " & SubItems.OEMUrl
TextFile.WriteLine "Started: " & SubItems.Started
TextFile.WriteLine "StartMode: " & SubItems.StartMode
TextFile.WriteLine "Status: " & SubItems.Status
TextFile.WriteLine "SupportedPlatform: " & SubItems.SupportedPlatform
TextFile.WriteLine "SystemCreationClassName: " & SubItems.SystemCreationClassName
TextFile.WriteLine "SystemName: " & SubItems.SystemName
TextFile.WriteLine "Version: " & SubItems.Version
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\Win32_PrinterDriver.txt",1,True
No comments have been posted about Get the installed printer driver details using Win32_PrinterDriver WMI Class. Why not be the first to post a comment about Get the installed printer driver details using Win32_PrinterDriver WMI Class.