title: How can I disable Windows Firewall?
body: <p>Windows 7, 8.1</p>
  
  <p>I get an exception when I try <strong>to disable</strong> Windows Firewall. I try to do it with admin rights. But I haven't the same problem for Windows Firewall <em>enabling</em>. </p>
  
  <pre><code>Type NetFwMgrType = Type.GetTypeFromProgID("HNetCfg.FwMgr", false);
  INetFwMgr mgr = (INetFwMgr)Activator.CreateInstance(NetFwMgrType);
  
  // Get the Windows Firewall status
  bool firewallEnabled = mgr.LocalPolicy.CurrentProfile.FirewallEnabled;
  
  // it works fine...
  String frw_status = "Windows Firewall is " + (firewallEnabled ?
      "enabled" : "disabled");
  
  // Enable or disable firewall.
  
  // I get the exception here when I try to disable Windows Firewall.
  // I have not problem when I try to enable Windows Firewall (it works fine).
  //
  // Exception message:
  //   An unhandled exception of type 'System.NotImplementedException' 
  //   occurred in net_sandbox.exe
  //   Additional information: Method or operation is not emplemented yet..
  mgr.LocalPolicy.CurrentProfile.FirewallEnabled = false;
  </code></pre>
  
  <p>How can I disable Windows Firewall?</p>