3

Is there any way to on/off windows firewall using Java? I search on google and stack-overflow, i don't find anything useful.

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
Mahedi Sabuj
  • 2,894
  • 3
  • 14
  • 27

1 Answers1

3

Yes.

There is a COM interface that allows the firewall state to be controlled. Here's an example from MSDN in C++.

Note that your Java program needs elevated permissions to change the setting.

For tips on using COM from Java, see

Is it possible to call a COM API from Java?

Community
  • 1
  • 1
Eric J.
  • 147,927
  • 63
  • 340
  • 553