# [HELP]Batch file for defaulting new printer if current is offline.



## bryantan101 (May 22, 2013)

Greetings Guys,

I am rather new to batch file scripting. Currently supporting IT services in a health institution.

I have found a way to default printers on start up

RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printername"

However, my registration counters run more than one printer for SAP printing, I am looking for way to do the following in order:

if printerA exists
set printerA as default
else if
printerB exists
set printerB as default
else 
set printerC as default

I might be getting this wrong.


----------



## foxidrive (Oct 20, 2012)

you could ping the printer and if it is online set it to the default printer.

ping printer1-IP >nul && (RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printername1" & goto :EOF)
ping printer2-IP >nul && (RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printername2" & goto :EOF)
ping printer3-IP >nul && (RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printername3" & goto :EOF)


----------

