VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get the installed Printer Configuration using Win32_PrinterConfiguration WMI Class

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 Configuration using Win32_PrinterConfiguration WMI Class

Rate Get the installed Printer Configuration using Win32_PrinterConfiguration 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_PrinterConfiguration.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_PrinterConfiguration Class by Karthikeyan"
TextFile.WriteLine 
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_PrinterConfiguration",,48)
For Each SubItems in Items
TextFile.WriteLine "********************************************************************"
    TextFile.WriteLine "BitsPerPel: " & SubItems.BitsPerPel
    TextFile.WriteLine "Caption: " & SubItems.Caption
    TextFile.WriteLine "Collate: " & SubItems.Collate
    TextFile.WriteLine "Color: " & SubItems.Color
    TextFile.WriteLine "Copies: " & SubItems.Copies
    TextFile.WriteLine "Description: " & SubItems.Description
    TextFile.WriteLine "DeviceName: " & SubItems.DeviceName
    TextFile.WriteLine "DisplayFlags: " & SubItems.DisplayFlags
    TextFile.WriteLine "DisplayFrequency: " & SubItems.DisplayFrequency
    TextFile.WriteLine "DitherType: " & SubItems.DitherType
    TextFile.WriteLine "DriverVersion: " & SubItems.DriverVersion
    TextFile.WriteLine "Duplex: " & SubItems.Duplex
    TextFile.WriteLine "FormName: " & SubItems.FormName
    TextFile.WriteLine "HorizontalResolution: " & SubItems.HorizontalResolution
    TextFile.WriteLine "ICMIntent: " & SubItems.ICMIntent
    TextFile.WriteLine "ICMMethod: " & SubItems.ICMMethod
    TextFile.WriteLine "LogPixels: " & SubItems.LogPixels
    TextFile.WriteLine "MediaType: " & SubItems.MediaType
    TextFile.WriteLine "Name: " & SubItems.Name
    TextFile.WriteLine "Orientation: " & SubItems.Orientation
    TextFile.WriteLine "PaperLength: " & SubItems.PaperLength
    TextFile.WriteLine "PaperSize: " & SubItems.PaperSize
    TextFile.WriteLine "PaperWidth: " & SubItems.PaperWidth
    TextFile.WriteLine "PelsHeight: " & SubItems.PelsHeight
    TextFile.WriteLine "PelsWidth: " & SubItems.PelsWidth
    TextFile.WriteLine "PrintQuality: " & SubItems.PrintQuality
    TextFile.WriteLine "Scale: " & SubItems.Scale
    TextFile.WriteLine "SettingID: " & SubItems.SettingID
    TextFile.WriteLine "SpecificationVersion: " & SubItems.SpecificationVersion
    TextFile.WriteLine "TTOption: " & SubItems.TTOption
    TextFile.WriteLine "VerticalResolution: " & SubItems.VerticalResolution
    TextFile.WriteLine "XResolution: " & SubItems.XResolution
    TextFile.WriteLine "YResolution: " & SubItems.YResolution
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\Win32_PrinterConfiguration.txt",1,True


Download this snippet    Add to My Saved Code

Get the installed Printer Configuration using Win32_PrinterConfiguration WMI Class Comments

No comments have been posted about Get the installed Printer Configuration using Win32_PrinterConfiguration WMI Class. Why not be the first to post a comment about Get the installed Printer Configuration using Win32_PrinterConfiguration WMI Class.

Post your comment

Subject:
Message:
0/1000 characters