当前位置:首页 > 操作系统 > Windows

在Windows批处理程序中使用WIMC 查找正在运行的进程

@echo off
:SLEEP
TIMEOUT /T 60 /NOBREAK
:CHECK
echo %TIME% | findstr 23:5 >nul
if not errorlevel = 1 goto END
WMIC PROCESS WHERE NAME="java.exe" get commandline | findstr /i helloworld >nul
if not errorlevel goto RUNNING
:RUN
cd /D W:externalinputinput-trigger
if exist *-* (
    echo %date% - %time% - trigger file exist, start up the run.bat >>d: emplog.txt
    call d:apps un.bat
    goto SLEEP
) else (
    echo %date% - %time% - trigger file does not exist >>d: emplog.txt
    goto SLEEP
)
:RUNNING
echo %date% - %time% - helloworld is running >>d: emplog.txt
goto SLEEP
:END

原文:http://www.cnblogs.com/wencle/p/5348494.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐