Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows firewall on/off using JAVA

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

like image 470
Mahedi Sabuj Avatar asked May 17 '26 16:05

Mahedi Sabuj


1 Answers

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?

like image 94
Eric J. Avatar answered May 19 '26 05:05

Eric J.



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!