
NOTE: change the bellsouth part to your ip or domain name etc ..
NOTE: you also need kill.exe ( from NT reskit.zip )
[syntax="batch"]
@echo off
:loop
netstat | find "bellsouth" | find "EST" > nul
if errorlevel 1 goto restartvnc
cls
echo Keeping VNC connection alive
echo Time %time%
netstat | find "bellsouth" | find "EST"
ping 1.1.1.1 > %temp%\null
goto loop
:restartvnc
echo Connection lost Killing VNC Processes...
kill winvnc.exe
ping 1.1.1.1 > %temp%\nullnull
echo Reconnecting ...
start winvnc.exe
ping 1.1.1.1 > %temp%\nullnull
ping 1.1.1.1 > %temp%\nullnull
ping 1.1.1.1 > %temp%\nullnull
ping 1.1.1.1 > %temp%\nullnull
goto loop
[/syntax]
[mod=494,1134181391]replaced code by syntax=batch[/mod]