You can try something like this, just replace the line to find with the printer you want to find.
For /F "Tokens=4 delims=\" %%I In ('reg query HKCU\Printers\Connections ^|find /I "560C"') Do If "%%I"==",,ServerName,HP DeskJet 560C" goto :REMOVE goto :SKIP :REMOVE RUNDLL32 printui.dll,PrintUIEntry /n \\server\printerName /dn :SKIP
Or just run the command, and if it does not exist, will it be an error if it works?
Hope this helps!
source share