mode con: cols=50 lines=20
@echo off
rem adjust cols and lines to change size of cmd window
rem note mode con line MUST BE FIRST LINE IN BATCH FILE
rem 15 seems to be lowest number that will work
cd "C:\Program Files\uvnc bvba\UltraVNC\"
rem use the port you want to trigger
rem psping will trigger the port open
rem n66u currently holds the port trigger open for 10 minutes
rem some connections will become established and data will
rem continue through iptables established rules when there
rem is activity on the port
rem unfortunately ultravnc does not work correctly with port triggering
rem and konks out after 10 minutes regardless of activity
psping -q -i 0 -n 1 -q -w 0 www.google.com:????
rem use your vncviewer.exe command
start vncviewer.exe -dsmplugin SecureVNCPlugin64.dsm -listen ???? -disablesponsor -askexit -normalcursor -noauto -encoding tight -compresslevel 7 -quality 9 -password ????
set /a counter=0
:loop
ping -n 2 127.0.0.1
rem next line goes to EOF when vncviewer.exe is not a running process
tasklist /FI "IMAGENAME eq vncviewer.exe" | find /I /N "vncviewer.exe" || goto EOF
set /a counter+=1
echo.
echo *************************
echo counter is currently=%counter%
echo *************************
echo.
rem next line controls how many times the loop runs
rem note that ping -n 2 127.0.0.1 waits one second per loop
if %counter%==500 goto psping
goto loop
:psping
rem psping will reset the trigger timer to 0
rem ultravnc times out after 10 minutes with a
rem triggered port so under 10 minutes
rem of looping is required so the
rem connection is not dropped
psping -q -i 0 -n 1 -q -w 0 www.google.com:????
set /a counter=0
goto loop
:EOF