Jump to content

Recommended Posts

Posted

Hello, someone can help me in this problem?

post-46629-0-50597500-1367493238_thumb.j

I need to write a script that process a list of printers from the folder "Printers and Fax" of windows XP.

there is an autoit function that allows to obtain a list of names of defined printers of windows?

thanks

  • Moderators
Posted

I use this, personally. Most of my printers are network, but I believe it captures local as well:

$wbemFlagReturnImmediately = "&h10"
$wbemFlagForwardOnly = "&h20"

$WMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
$aItems = $WMI.ExecQuery("SELECT * FROM Win32_Printer", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

For $printer in $aItems
 MsgBox(0, "Printers", $printer.Name)
Next

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...