@echo off
set fuwuming="ANSYS FLEXlm license manager"
for /f "tokens=4" %%i in ('sc query %fuwuming%^|findstr /i "state.*:"') do (
if /i "%%i"=="stopped" (
sc start %fuwuming%
"C:\Program Files\Ansys Inc\v100\CommonFiles\TCL\bin\intel\wish.exe" "C:\Program Files\Ansys Inc\v100\CommonFiles\Launcher\LauncherMain.itcl" -runae
::如果ansys在其他盘,对应改这句路径
)
)
存为cmd或bat后缀文件,双击运行