检测openOffice关闭 自动重启

时间:2021-12-01 12:10:10
参考http://my.oschina.net/UpBoy/blog/301193
bat解释:循环检测任务列表找到soffice.exe,没找到就调用run.bat
 @echo off
:loop
tasklist|find /i "soffice.exe"
if %errorlevel%== (
call "run.bat"
)
ping -n 127.0.0.1>nul
goto loop

进入到安装目录下调用命令

 run.bat 启动OpenOffice服务
@echo off
c:
cd C:\Program Files (x86)\OpenOffice \program\
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
P: