Jump to content
Sign in to follow this  

Select printer name from list?

Recommended Posts


EDIT: I found the answer to this one, exactly what I was looking for, right here:

It's obviously going to be easy to adapt this to return the printer name to a variable. Apologies for wasting bandwidth.

====== Original post below =======

I've searched the forum for the answer to this question but haven't found one. Has anyone written a script that displays a list of the names of the currently-installed Windows printers, and lets the user select one, and then inserts that name as a variable?

I've found quite a few scripts that return very detailed printer information, but none that simply list the names of each printer.

I see that I need to start with something like this code:

For $i = 1 To 100
    Local $var = RegEnumVal("HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionDevices", $i)
    If @error <> 0 Then ExitLoop
    MsgBox(4096, "Printer name " & $i, $var)

But I don't see how to get each item into a list that a user can choose from. That's probably the simplest part of the problem, and I apologize for asking a beginner's question.

Thanks for any help.

Edited by emendelson

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.