1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| @echo off
setlocal enabledelayedexpansion
set ProcessId=
set CommandLine=
for /f "usebackq skip=1 delims=" %%a in (`wmic process where "Name=\"java.exe\"" get Processid^,CommandLine`) do (
for /f "usebackq tokens=1-26" %%A in ('%%a') do (
for %%b in (%%Z,%%Y,%%X,%%W,%%V,%%U,%%T,%%S,%%R,%%Q,%%P,%%O,%%N,%%M,%%L,%%K,%%J,%%I,%%H,%%G,%%F,%%E,%%D,%%C,%%B,%%A) do (
if not defined ProcessId (
if not "%%~b"=="" set ProcessId=%%b
) else (
set CommandLine=%%b !CommandLine!
)
)
echo ProcessId=!ProcessId!
echo CommandLine=!CommandLine!
set ProcessId=
set CommandLine=
)
)
pause |