Today i got into a problem when i wanted to stop/kill Jmeter process from command line.
But as Jmeter runs as a java.exe process, so we cant just kill the java processes to stop the Jmeter.
So i tried just a little hack to kill only the Jmeter process and it worked... :)
You can try the following command in windows command promt for this.
Execute the following command on windows command line one by one ================================================================
1: FOR /F "tokens=*" %%G IN ('netstat -o ^| find /C "8085"') DO SET JCOUNT=%%G 2: SET /a JCOUNT-=1 3: FOR /F "tokens=5 skip=%JCOUNT%" %%G IN ('netstat -o ^| findstr 8085') DO taskkill /F /PID %%G
Or you can put all the above files in a batch file and execute that.
In the above command replace the port '8085' with the port number you are using for Jmeter to start on.
© automatethebox. All Rights Reserved