0

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

S.O.S
  • 848
  • 10
  • 30
  • did you try taskkill? – S.K. Aug 13 '18 at 04:46
  • @S.K. What is the full command to kill a specific profile? – S.O.S Aug 13 '18 at 18:15
  • I think it will not be possible from taskkill. Please see https://stackoverflow.com/questions/28674066/close-multiple-profiles-of-firefox-using-cmd and https://stackoverflow.com/questions/13961724/how-to-kill-firefox-gracefully-from-command-line and – S.K. Aug 14 '18 at 06:05

0 Answers0