Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enum default printer????

Status
Not open for further replies.

AntunB

IS-IT--Management
Aug 11, 2003
263
AU
is there a way to see which printer is set to the default?????

wmi or wsh?

thanks
 
ok found it

WMI

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Printer", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objItem In colItems
If objItem.Default = True AND Then
sDefault = Ucase(objItem.Caption)
end if
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top