第次开机时都会打开一些常用必要的软件,打开时还要去找相应的图标,比较麻烦,所以做了个简单的批处理,双击后,可以按顺序打开批处理中设定的软件。
通过批处理查看任务管理器中软件是否已经打开,如果打开了,则跳过,否则从给定的路径中打开对应的软件。
@echo off
::在批处理开关加入这段代码,可以实现批处理在后台运行
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
set /a pstart=0
:notes
for /f %%i in ('tasklist /nh') do if "%%i"== "nlnotes.exe" goto qq rem 检查进程,查看邮箱是否启动
set /a pstart=1
call "F:\Lotus8.5\Notes\notes.exe"
:qq
for /f %%i in ('tasklist /nh') do if "%%i"== "QQ.exe" goto :weChat rem 检查进程,查看QQ是否启动
if %pstart%==1 ping 127.1 -w 1000 -n 6 >nul rem 如果邮箱新启动的,延时5秒
set /a pstart=1
call "C:\Program Files (x86)\Tencent\QQLite\Bin\QQScLauncher.exe"
:weChat
for /f %%i in ('tasklist /nh') do if "%%i"== "WeChat.exe" goto :end rem 检查进程,查看微信是否启动
if %pstart%==1 ping 127.1 -w 1000 -n 6 >nul rem 如果邮箱或者QQ新启动的,延时5秒
call "C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"
:end