{"id":81,"date":"2021-08-16T22:10:34","date_gmt":"2021-08-16T21:10:34","guid":{"rendered":"https:\/\/wordpress.pedrorotoli.com\/?p=81"},"modified":"2021-08-16T22:10:34","modified_gmt":"2021-08-16T21:10:34","slug":"windows-defender-firewall-block-entire-directory","status":"publish","type":"post","link":"https:\/\/wordpress.pedrorotoli.com\/?p=81","title":{"rendered":"Windows Defender Firewall &#8211; Block Entire Directory"},"content":{"rendered":"\n<p>Unfortunately Windows Defender Firewall only allows the creation of individual rules for single applications one at a time, if you need to block a whole directory, you need to either create an individual rule for each of the applications, use a third party application or a script.<\/p>\n\n\n\n<p>This script can accomplish just that.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">@ setlocal enableextensions\n@ cd \/d \"%~dp0\"\n\nfor \/R %%f in (*.exe) do (\nnetsh advfirewall firewall add rule name=\"Blocked: %%f\" dir=out program=\"%%f\" action=block\n)\npause<\/pre>\n\n\n\n<p>Just save that as a .bat file and run it as administrator from the directory where you want to block all outbound connections from the programs it contains.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unfortunately Windows Defender Firewall only allows the creation of individual rules for single applications one at a time, if you need to block a whole<\/p>\n","protected":false},"author":1,"featured_media":82,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[21,19,17,20,16,18,14,15],"class_list":["post-81","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows","tag-application","tag-batch","tag-bulk","tag-directory","tag-firewall","tag-script","tag-windows","tag-windows-defender"],"_links":{"self":[{"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=\/wp\/v2\/posts\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=81"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=\/wp\/v2\/posts\/81\/revisions"}],"predecessor-version":[{"id":83,"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=\/wp\/v2\/posts\/81\/revisions\/83"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=\/wp\/v2\/media\/82"}],"wp:attachment":[{"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.pedrorotoli.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}