@echo off echo Reconnecting ... start winvnc.exe Timeout.exe 10 :loop netstat -n | find ":7070" if errorlevel 1 goto restartvnc cls echo Keeping VNC connection alive echo !!!! DO NOT CLOSE THIS WINDOW !!!! echo !!! DO NOT PRESS ANY KEYS OR CLICK THIS WINDOW !!!! Timeout.exe 30 goto loop :restartvnc echo Connection lost Killing VNC Processes... kill winvnc.exe Timeout.exe 10 echo Reconnecting ... start winvnc.exe Timeout.exe 10 goto loop