@ECHO OFF
ECHO ************************************************************************
ECHO * Checking if Printer LAN is still available *
ECHO ************************************************************************
PING 192.168.11.90
IF ERRORLEVEL 1 goto ende1
IF NOT ERRORLEVEL 1 goto dienst
:ende1
cls
ECHO ************************************************************************
ECHO * Adding the Printer NIC to the Local Machine *
ECHO ************************************************************************
netsh int ip add address Local Area Connection 192.168.11.90 255.255.255.0
goto start
:dienst
cls
ECHO ************************************************************************
ECHO * Checking if Spooler is still available *
ECHO ************************************************************************
sc \\192.168.11.101 start spooler
if errorlevel 1 goto error
if not errorlevel 1 goto all
:error
cls
ECHO ************************************************************************
ECHO * Closedown the Printer Server *
ECHO ************************************************************************
shutdown /s /m \\192.168.11.101
goto ping
:start
cls
ECHO ************************************************************************
ECHO * Waiting till System is online again *
ECHO ************************************************************************
PING 192.168.11.101
IF ERRORLEVEL 1 goto start
IF NOT ERRORLEVEL 1 goto ende
ing
cls
ECHO ************************************************************************
ECHO * Waiting for System to come online *
ECHO ************************************************************************
PING 192.168.11.90
IF NOT ERRORLEVEL 1 goto ping
IF ERRORLEVEL 1 goto set
:ende
cls
ECHO ************************************************************************
ECHO *Please Press Enter ant than Disable and Enable the Remote Printer NIC *
ECHO ************************************************************************
pause
netsh int ip delete address Local Area Connection 192.168.11.90
goto all
:set
cls
ECHO ************************************************************************
ECHO * The Print IP will be added to the local System *
ECHO ************************************************************************
netsh int ip add address Local Area Connection 192.168.11.90 255.255.255.0
:all
cls
ECHO ************************************************************************
ECHO * All changes have been done *
ECHO ************************************************************************
pause