enable firewall rule:

1
run, netsh advfirewall firewall set rule name="NameOfFirewallRule" new enable=yes

disable firewall rule:

1
run, netsh advfirewall firewall set rule name="NameOfFirewallRule" new enable=no