如何用一些缓冲时间编写用于重新启动 Windchill 的批处理文件?

How to write a Batch file for Restarting Windchill with some Buffer time?

我需要重新启动我的 windchill 服务。当前 windchill 停止和 windchill 启动命令正在 windchill shell 中使用。我需要为此操作编写批处理文件。在做了一些研究之后我决定这样写..

NET STOP windchill stop
:: Also I have to set some buffer time for service stopping
NET START windchill start

如果 windchill 不是 运行 作为服务:

windchill stop && windchill start

如果 windchill stop 成功,条件 && 将只允许执行 windchill start。也就是说,returns %errorlevel% of 1

如果你想依赖超时,那么使用 timeout 希望它不会花很长时间。

windchill stop
:wait
timeout /t 5 >nul 2>&1
windchill status | find /I "stopped"
if %errorlevel% equ 0 (
  windchill start
  goto :eof
)
goto :wait

以上示例超时 10 秒。