(view source code of getprnnt.bat as plain text)
@ECHO OFF
:: GetPrn.bat, Version 1.01
:: Displays network printers plus default
:: printer for current user on current system.
:: Written for multi-vendor networks using NetBIOS.
:: Use GetPrn2.bat for "real" NT/2000 networks.
:: Requires REG.EXE from the Microsoft Windows NT 4 Resource Kit
::
:: Written by Rob van der Woude
:: http://www.robvanderwoude.com
SETLOCAL
ECHO Default printer defined for %username%:
FOR /F "tokens=3* delims=]," %%A IN ('REG QUERY HKCU\Printers\Connections ^| FIND /V "Listing" ^| find "["') DO ECHO. %%A
ECHO Network printers defined on %computername%:
:: Delims is a TAB followed by a space
FOR /F "tokens=3* delims= " %%A in ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers" /S ^| FIND "Share Name"') DO ECHO. %%B
ECHO.
ENDLOCAL
GOTO:EOF
page last modified: 2024-04-16; loaded in 0.0073 seconds