How to capture the PID of a process when launching it from command line?
Here’s what I use: @echo off rem there is a tab in the file at the end of the line below set tab= set cmd=javaw -jar lib\MyProg.jar set dir=%~dp0 echo Starting MyProg set pid=notfound for /F “usebackq tokens=1,2 delims=;=%tab% ” %%i in ( `wmic process call create “%cmd%”^, “%dir%”` ) do ( if /I %%i … Read more