- @echo off
- setlocal enableDelayedExpansion
- set "run=wmic process call create"
- ((((((((((
- for %%a in (
- "d:\acc\acc.exe"
- "d:\rel\rel.exe"
- "d:\sec\sec.exe"
- "d:\msg1\123.exe"
- "d:\msg1\456.exe"
- "d:\msg2\123.exe"
- "d:\msg2\456.exe"
- ) do echo run "%%~a">&2 & %run% "%%~a","%%~dpa"|findstr ProcessId >~tmp && (
- for /f "tokens=1,2 delims==; " %%i in (~tmp) do set %%i=%%j
- set /p=Succeed to run "%%~a", <nul
- wmic process !ProcessId! get name|find /i "%%~nxa" >nul && (echo OK.) || (echo but it died subsequently^^!)
- ) || (echo Failed to run "%%~a" ^^!)
- )))))))))) >xx.log
- del ~tmp
- pause
- start xx.log
复制代码
|