Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a specific Java program is running with Windows CMD?

Tags:

java

windows

cmd

How can I find out via CMD if a certain Java program is running on my PC? When I enter

tasklist | find "javaw"

into the command line, I can see how many javaw.exe files are executed, but I can't assign which "javaw.exe" belongs to which special Java program. How do I know if my "XY.class" is currently running?

like image 409
LCP Avatar asked Aug 27 '26 15:08

LCP


1 Answers

As noted here https://superuser.com/questions/415360/how-do-i-find-out-command-line-arguments-of-a-running-program

You can do it without Process Explorer, too, using Windows' WMI service. Run the following from the command prompt:

WMIC path win32_process get Caption,Processid,Commandline

If you want to dump the output to a file (makes it a bit easier to read), use the /OUTPUT switch:

WMIC /OUTPUT:C:\Process.txt path win32_process get Caption,Processid,Commandline

You could grep the output - if you have unix tools installed/ git-scm.

This worked too

WMIC path win32_process get Caption,Processid,Commandline | find "java"
like image 124
tgkprog Avatar answered Aug 29 '26 05:08

tgkprog



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!