Just having a little fun with this...
Microsoft.com - Managing Printer Operations
Code:
break on
$dp=GetDefaultPrinterProperties
? "Capabilities: " + join($dp.Capabilities,",")
? "CapabilityDescriptions: " + join($dp.CapabilityDescriptions,",")
? "Description: " + $dp.Description
? "DeviceID: " + $dp.DeviceID
? "DriverName: " + $dp.DriverName
? "Location: " + $dp.Location
? "Name: " + $dp.Name
? "PortName: " + $dp.PortName
? "Separtor File: " + $dp.SeparatorFile
? "ServerName: " + $dp.ServerName
? "ShareName: " + $dp.ShareName
? "StartTime: " + $dp.StartTime
? "TimeofLastReset: " + $dp.TimeOfLastReset
? "UntilTime: " + $dp.UntilTime
Function GetDefaultPrinterProperties()
dim $colprinters,$printer
$colprinters=GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select * From Win32_Printer Where Default = TRUE")
if @error
exit @error
endif
for each $printer in $colprinters
$GetDefaultPrinterProperties=$printer
next
endfunction
Produces:
Code:
Capabilities: 4,3,5
CapabilityDescriptions: Copies,Duplex,Collate
Description:
DeviceID: hp LaserJet 1012
DriverName: hp LaserJet 1012
Location:
Name: hp LaserJet 1012
PortName: IP_192.168.0.2
Separtor File:
ServerName:
ShareName:
StartTime:
TimeofLastReset:
UntilTime: