checkVncLink
参考1
参考2
参考3
choice /t 10 /c ync /n /d y /m (如果想取消定时关机,请打开取消关机脚本)
/t 后面跟着是延长10秒
/c ync y表示是,n表示否,c表示取消,默认下yn
/n 掩藏ync的提示符
/d 选择默认y
/m 后面表示要显示的内容
@echo off
setlocal enabledelayedexpansion
:start
set softPath=C:/Program Files (x86)/Sangfor/SSL/EasyConnect/EasyConnect.exe
set host=10.16.130.27
set port=8788
set timeout=5
set stime=3600
set stimeFirst=30
set current=%Time:~0,2%
set exitStart=7
set exitEnd=18
if %current% GEQ %exitStart% (
if %current% LSS %exitEnd% (
echo not close
echo Check EasyConnect... %Date:~0,4%-%Date:~5,2%-%Date:~8,2% %Time:~0,2%:%Time:~3,2%
start /min telnet.exe %host% %port%
choice /t %stimeFirst% /d y /n >nul
tasklist|findstr /i "telnet.exe" > nul
if errorlevel 1 (
echo "EasyConnect close"
taskkill /f /im SangforPromoteService.exe
taskkill /f /im EasyConnect.exe
taskkill /f /im SangforCSClient.exe
taskkill /f /im SangforServiceClient.exe
taskkill /f /im SangforUDProtectEx.exe
taskkill /f /im SangforPWEx.exe
choice /t %timeout% /d y /n >nul
echo EasyConnect start
start "" "%softPath%"
taskkill /F -IM "telnet.exe" >> nul
) else (
taskkill /F -IM "telnet.exe" >> nul
echo EasyConnect Services is running %Date:~0,4%-%Date:~5,2%-%Date:~8,2% %Time:~0,2%:%Time:~3,2%
)
) else (
echo close
choice /t %timeout% /d y /n >nul
exit
)
) else (
echo close
choice /t %timeout% /d y /n >nul
exit
)
:end
choice /t %stime% /d y /n >nul
goto start