Jump to content
Sign in to follow this  
af3m1a

list of windows printers name

Recommended Posts

af3m1a

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

Share this post


Link to post
Share on other sites
Richard Robertson

http://msdn.microsoft.com/en-us/library/windows/desktop/dd162692%28v=vs.85%29.aspx

This function will list all the installed printers. Requires an understanding of C/C++ programming to use though.

Share this post


Link to post
Share on other sites
JLogan3o13

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

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×