需要使用批处理文件检查进程是否正在运行以及正在使用的端口(8086和8085)是否处于监听状态。
需要使用批处理文件检查进程是否正在运行以及正在使用的端口(8086和8085)是否处于监听状态。
netstat /o /a | find /i "listening" | find ":8086" >nul 2>nul && (
echo 8086 is open
) || (
echo 8086 is Not open
)
netstat -o -n -a | findstr 8086
if %ERRORLEVEL% equ 0 goto FOUND
echo port not found
goto FIN
:FOUND
echo port found
:FIN