Microsoft Windows XP comes with a VBS script to manage local and network printers from the command line:
To Get the default printer details from command line:
<
Using a batch file (no VBScript files):
@echo off
::Get printer CLSID
for /f %%a in ('reg query HKCU\Printers\Defaults') do (set regkey=%%a)
::Get printer name from the previous CLSID
for /f "tokens=3*" %%a in ('reg query %regkey%') do (set printername=%%a %%b)
echo Printer name is: %printername%
I wish that could help you