I'd like to close/kill a specific Firefox Profile via command line in Java.
Based on what I read here I am able to start any Firefox Profile using this code:
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("cmd.exe /c start firefox -P " + profile);
This works perfectly.
However, the document also states that there is an option to kill a specific Firefox Profile via the -kill
command. However, I've tried several different variations and none of them seem to work:
rt.exec("cmd.exe /c firefox kill -P " + profile);
rt.exec("cmd.exe /c kill firefox -P " + profile);
rt.exec("cmd.exe /c pkill firefox -P " + profile);
The documentation states these "other (command) options need to be documented" but I haven't found any documentation on how to kill a specific profile after searching for hours.
What is the correct syntax/command to use?
I'm using Java on Windows machine.
Thanks