Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a command that can be used from the command line to output a list of the printers installed and their location, if mapped, to a text file? Or perhaps a program that I can run from the command line that would do this?

share|improve this question

3 Answers 3

up vote 12 down vote accepted

In Windows XP use prntmngr:

PRNMNGR -l >> C:\printers.txt

In Windows Vista and beyond, use PowerShell:

get-WmiObject -class Win32_printer | ft name, systemName, shareName >> c:\printers.txt

Note: You MAY get an error if you attempt to write the file to C:\ on Vista+, depending on your rights, and how PowerShell was spawned.

For Windows 2000:

The PrnMngr.vbs file from XP (located in the /Windows/System32 folder) does work on Windows 2000. Just find and copy it over to the 2000 machine from an XP machine and run it with cscript prnmngr.vbs -l >> c:\printers.txt.

I found it wouldn't run from my user's desktop for some reason, but when I copied the .VBS to the root of C: it ran fine.

share|improve this answer
    
Worked beautifully! –  user35406 Apr 28 '10 at 4:56

Sometimes you don't want to use PS in win7 (I have an application that lets me do administrative work in the background on remote PCs, but it doesn't use powershell). The XP visual basic scripts mentioned can be found in the following folder for Win7: C:\Windows\System32\Printing_Admin_Scripts\en-US

share|improve this answer

Note: For Windows XP, be sure to change the default script host to CScript first

C:\CScript //H:CScript

otherwise you will get a message telling you to do so and your printers.txt file will be blank.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.