gavinbaumanis
03/24/2023, 12:54 AMbdw429s
03/24/2023, 1:00 AMset myEnvVar=thisIsMyValuegavinbaumanis
03/24/2023, 2:13 AMFOR /F "tokens=*" %g IN (`wmic PROCESS where "name like '%java%' and CommandLine like '%surveyEngine%'" get ProcessId`) DO (SET var=%g)
ECHO %var%
But the because the command actually returns 3 rows output, the second being the ID
) Users\gavin>(SET var=ProcessId
) Users\gavin>(SET var=4964
) Users\gavin>(SET var=
The actual value I am getting back is not a process ID.
in fact running echo %var% give me echo is on.
All I am trying to do is to see if there is a process running already before I attempt to stop it.
Or rather - only attempt to stop it - if it is actually running.
Because the batch file is individual "box" command lines - it take a little while spawn the box process and get a result - so I am just trying to speed up the process.bdw429s
03/24/2023, 1:44 PMserver info name=your-server-name property=statusbdw429s
03/24/2023, 1:44 PMrunning or stoppedbdw429s
03/24/2023, 1:45 PMserver info name=cfconfig property=pidfile | catbdw429s
03/24/2023, 1:45 PMgavinbaumanis
03/24/2023, 1:52 PMbdw429s
03/24/2023, 1:52 PMbdw429s
03/24/2023, 1:53 PMbdw429s
03/24/2023, 1:53 PMbdw429s
03/24/2023, 1:53 PMbdw429s
03/24/2023, 1:54 PMbdw429s
03/24/2023, 1:54 PMgavinbaumanis
03/24/2023, 1:57 PMgavinbaumanis
03/24/2023, 2:05 PMbdw429s
03/24/2023, 2:12 PM