//blocking....
Runtime r = Runtime.getRuntime();
Process p = r.exec("netsh advfirewall firewall add rule name=abc action=block remoteip=any dir=in");
//unblocking...
Runtime r = Runtime.getRuntime();
Process p = r.exec("netsh advfirewall firewall delete rule name=abc remoteip=any");
//to turn on windows firewall
Runtime r = Runtime.getRuntime();
Process p = r.exec("netsh firewall set opmode enable");
//to turn off windows firewall
Runtime r = Runtime.getRuntime();
Process p = r.exec("netsh firewall set opmode disable");
Runtime r = Runtime.getRuntime();
Process p = r.exec("netsh advfirewall firewall add rule name=abc action=block remoteip=any dir=in");
//unblocking...
Runtime r = Runtime.getRuntime();
Process p = r.exec("netsh advfirewall firewall delete rule name=abc remoteip=any");
//to turn on windows firewall
Runtime r = Runtime.getRuntime();
Process p = r.exec("netsh firewall set opmode enable");
//to turn off windows firewall
Runtime r = Runtime.getRuntime();
Process p = r.exec("netsh firewall set opmode disable");
really interesting........expecting more . . . .
ReplyDelete