1.新建bat文件:新建txt文件,右键重命名将“新建文本文档.txt ”改成"xshell.bat"即可(位置随意)。
2.编辑xshell.bat文件,然后复制下面的代码。
##################################begin####################
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c%~s0::","","runas",1)(window.close)
title Xshell启动器
set atime=%date:~0,4%-%date:~5,2%-%date:~8,2%
#设置系统时间
date 2018-12-31
#改成你的xshell启动路径
start "" "D:\Program Files (x86)\NetSarang\Xshell 7\Xshell.exe"
echo 启动软件中...
ping 0.0.0.0 -n 10> null
echo 同步时间中,完成后自动关闭窗口...
date %atime%
exit
重新打开xshell就可以了
参考链接:https://blog.csdn.net/baidu_41614347/article/details/121951302