List printers from command line to text file
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.
I use:
wmic printer list brief
OR
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:
>>"[directory]\[filename].txt"
Example:
wmic printer list brief >> c:\users\admin\documents\printerlist.txt
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