目的:现有一套认证系统,当主机长时间不产生数据流量后会强制主机下线,故定期刷新页面防止主机被强制下线,编写启动bat脚本添加进启动项管理.
@echo off
cd C:\Program Files (x86)\Google\Chrome\Application
if exist C:\Users\user\Desktop\flush.html (
::用 errorlevel,0为成功,1为不成功 判断一条命令是否执行成功
chrome.exe --kiosk C:\Users\user\Desktop\flush.html
if errorlevel 0 (
echo "success"
)
) else (
echo "check file flush.html"
)
pause
对应flush.html
设置定时刷新,防止主机长时间无数据交互,断开连接.
<!DOCTYPE html>
<html>
<!-- content 设置刷新时间 -->
<meta http-equiv="refresh" content="3600">
<head>
<title>定时刷新</title>
</head>
<body>
<iframe src="http://www.baidu.com" style="width: 600px;height: 600px"></iframe>
</body>
</html>