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?

8 Answers 8


In Windows XP use prntmngr:

PRNMNGR -l >> C:\printers.txt

In Windows XP SP3 Vista and beyond (you need to install powershell v1 manually) , 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.

  • Worked beautifully!
    – user35406
    Apr 28, 2010 at 4:56
  • In windows XP SP3 you can manually install Powershell c1 and it will also work there.
    – Wasif
    Sep 20, 2020 at 15:45

I use:

wmic printer list brief


wmic printer get name

This just shows a short list of printer attached to the system you run the command on. It will also show what computer a printer is connected to if there's a network printer.

You can also use this to get a very detailed list of configuration for each printer installed on a system:

wmic printer list full

To output it to a text file, append this to the end of the command:



wmic printer list brief >> c:\users\admin\documents\printerlist.txt
  • 1
    This should be the accepted answer. Dec 20, 2017 at 16:37

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:


Starting with Windows 8 / Server 2012, there is a get-printer PowerShell cmdlet:


  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Aug 3, 2016 at 20:04

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.


In PowerShell ISE you can run this to see a list of all installed printers.


See the dot.net PrinterSettings.InstalledPrinters Property for more info.

  • Welcome to Super User. Can you say anything more than this? While I think this is technically an answer, it leaves a lot to the imagination and as such isn't a high-quality answer. Apr 17, 2019 at 23:24

Since WMI is being depreciated, I will use CIM in powershell:

Get-CIMInstance CIM_Printer | Format-Table Name,SystemName,ShareName >>printers.txt

So this is my solution (in AutoHotKey):

; cmd calls hidden

global cPid
DetectHiddenWindows, on
Run, %comspec% /k ,,Hide UseErrorLevel,cPid
WinWait, ahk_pid %cPid%,, 1

;******* GET PRINTER NAMES **********

AllPrintersNameClearArray := strSplit(StrReplace(StrReplace(StrReplace(StrReplace("|" StrReplace(StrReplace(StrReplace(RunWaitOne("wmic printer get name"),"  ","")," `r",""),"`r",""),"|NAME`n",""),"`n","|"),"||","",All),"|","`n"),"`n")

RunWaitOne(command) {

    objShell := ComObjCreate("WScript.Shell")
    objExec := objShell.Exec(command)
    strStdOut := ""
    while, !objExec.StdOut.AtEndOfStream
    strStdOut := objExec.StdOut.ReadAll()
    return %strStdOut%

; **** Clean at the end *****

DllCall("CloseHandle", "uint", hCon)
Process, Close, %cPid%
  • What language is this? Please write more about how this works.
    – stomy
    Jun 25, 2020 at 19:55
  • 1
    @stomy this is an Autohotkey script.
    – Wasif
    Sep 20, 2020 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy