23 lines
482 B
Batchfile
23 lines
482 B
Batchfile
@ECHO OFF
|
|
set path=%PATH%
|
|
|
|
set myPrintServer=RECEPTION2
|
|
set myPrinter=BROTHER
|
|
|
|
|
|
REM Check if myPrintServer is reachable
|
|
ping -n 1 %myPrintServer% >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo "%myPrintServer% is not reachable"
|
|
exit /b
|
|
)
|
|
|
|
REM Check if myPrinter is available
|
|
rundll32 printui.dll,PrintUIEntry /q /t1 /n "\\%myPrintServer%\%myPrinter%" >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo Printer %myPrinter% is not available.
|
|
) else (
|
|
echo Printer %myPrinter% is available.
|
|
)
|
|
|
|
exit /b |