{"id":339,"date":"2008-06-19T14:15:54","date_gmt":"2008-06-19T08:45:54","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=339"},"modified":"2019-04-25T06:43:29","modified_gmt":"2019-04-25T06:43:29","slug":"enable-and-disable-windows-firewall-quickly-using-command-line","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/enable-and-disable-windows-firewall-quickly-using-command-line\/","title":{"rendered":"Enable and Disable Windows Firewall Quickly using Command-line"},"content":{"rendered":"<p>When testing network connectivity or when performing other troubleshooting tasks, you may need to turn off the Windows Firewall temporarily. To quickly disable or enable the Windows Firewall, you may use the <strong>Netsh.exe<\/strong> command-line in Windows 10 and Windows 8.<!--more--><\/p>\n<h2>Enable and Disable Windows Firewall Quickly using Command-line<\/h2>\n<p>To disable the Windows Firewall, run the following command from <a href=\"https:\/\/www.winhelponline.com\/blog\/open-elevated-command-prompt-windows\/\">elevated Command Prompt<\/a>.<\/p>\n<pre>netsh advfirewall set allprofiles state off<\/pre>\n<p>This turns off Windows Firewall for <strong>all<\/strong> the profiles.<\/p>\n<div class=\"qt\">\nWhen you create firewall rules to allow or block traffic, you can separately apply them to the Domain, Private, and Public profiles. Let&#8217;s say you&#8217;re using a laptop. These three different profiles enable laptop computers to allow incoming connections while connected to a domain network, but block connection attempts on less secure networks (such as public wireless hotspots).<\/p>\n<ol>\n<li><strong>Domain profile<\/strong> applies when a computer is connected to its Active Directory domain. If the member computer&#8217;s domain controller is accessible, this profile will be applied.<\/li>\n<li><strong>Private profile<\/strong> applies when a computer is connected to a private network location. By default, no networks are considered private\u2014users must specifically mark a network location, such as their home office network, as private.<\/li>\n<li><strong>Public profile<\/strong> is the default profile applied to all networks when a domain controller is not available. For example, the Public profile is applied when users connect to Wi-Fi hotspots at airports or coffee shops. By default, the Public profile allows outgoing connections but blocks all incoming traffic that is not part of an existing connection.<\/li>\n<\/ol>\n<\/div>\n<p>To turn <strong>off<\/strong> Windows Firewall for a particular profile, use the following command-line examples:<\/p>\n<pre>netsh advfirewall set privateprofile state off<\/pre>\n<pre>netsh advfirewall set publicprofile state off<\/pre>\n<pre>netsh advfirewall set domainprofile state off<\/pre>\n<pre>netsh advfirewall set currentprofile state off<\/pre>\n<p><em>You can also use the <strong>currentprofile<\/strong> parameter. When you use <strong>currentprofile<\/strong>, the command effects changes for the currently active firewall profile (Public, Private or Domain). For example, your laptop may use the domain profile when at your office room, public profile when at the cafeteria etc.<\/em><\/p>\n<p>To know the state of Windows Firewall for every profile, run this command:<\/p>\n<pre>netsh advfirewall show allprofiles<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/06\/netsh-firewall-show-profiles.png\" alt=\"netsh firewall show profiles state\" width=\"699\" height=\"480\" class=\"alignnone size-full wp-image-8848\" \/><\/p>\n<p>The <strong>State<\/strong> (ON|OFF) field tells you if the Firewall is enabled for a profile or not.<\/p>\n<p>Windows Firewall status can also be verified using the Security Center (or Windows Firewall security center).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/06\/firewall-turned-off-settings.png\" alt=\"windows firewall turned off - security center\" width=\"700\" height=\"690\" class=\"alignnone size-full wp-image-8849\" \/><\/p>\n<p>The moment you set the Windows Firewall state to OFF for any profile, you&#8217;ll immediately see this notification in the taskbar.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/06\/firewall-turned-off-notification.png\" alt=\"windows firewall turned off notification\" width=\"370\" height=\"193\" class=\"alignnone size-full wp-image-8850\" \/><\/p>\n<p><strong>Enabling Windows Firewall<\/strong><\/p>\n<p>To enable the firewall, use the on parameter with the above command-line:<\/p>\n<p>Examples:<\/p>\n<pre>netsh advfirewall set privateprofile state on<\/pre>\n<pre>netsh advfirewall set publicprofile state on<\/pre>\n<pre>netsh advfirewall set domainprofile state on<\/pre>\n<p>You may create desktop two shortcuts to enable and disable the Windows Firewall. To run the commands as administrator, right-click on the shortcut and choose <b>Run as administrator<\/b>. Or right-click the shortcut properties, click <b>Advanced<\/b> and tick the <b>Run as administrator<\/b> checkbox and click <b>OK<\/b>. Double-clicking the shortcut run the <b>Netsh&#8230;<\/b> command elevated, after you click the <b>Continue<\/b> button in the UAC confirmation dialog.<\/p>\n<h3>Using PowerShell<\/h3>\n<p>From PowerShell (administrator) prompt, run the following command to disable Windows Firewall for all profiles.<\/p>\n<pre>Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False<\/pre>\n<p>To enable it back, run:<\/p>\n<pre>Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True<\/pre>\n<p>That&#8217;s it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When testing network connectivity or when performing other troubleshooting tasks, you may need to turn off the Windows Firewall temporarily. To quickly disable or enable the Windows Firewall, you may use the Netsh.exe command-line in Windows 10 and Windows 8.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[8,10],"tags":[669],"class_list":["post-339","post","type-post","status-publish","format-standard","hentry","category-windows-10","category-windows-8","tag-windows-firewall"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":4516,"url":"https:\/\/www.winhelponline.com\/blog\/reset-firewall-defaults-restore-rules-advanced-security\/","url_meta":{"origin":339,"position":0},"title":"How to Reset Windows Firewall Settings to Defaults","author":"Ramesh","date":"November 4, 2016","format":false,"excerpt":"You may want to occasionally reset Windows firewall settings or rules to clear any unused entries there in the aftermath of malware attack and removal, or when some of the networking features don't work due to misconfiguration of the Windows Firewall. Windows Firewall has predefined Inbound and Outbound connection rules\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"reset windows firewall settings","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/11\/firewall-rules-reset-0.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/11\/firewall-rules-reset-0.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/11\/firewall-rules-reset-0.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/11\/firewall-rules-reset-0.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":55484,"url":"https:\/\/www.winhelponline.com\/blog\/reset-winhttp-proxy-settings\/","url_meta":{"origin":339,"position":1},"title":"Reset WinHTTP Proxy Settings in Windows 10 or 11","author":"Ramesh","date":"June 22, 2023","format":false,"excerpt":"Sometimes, you may have to reset the WinHTTP proxy, firewall or network settings to fix connectivity issues when using Windows Update, Microsoft Store, or other apps. WinHTTP provides the HTTP client APIs, which are used by desktop applications and Windows services. This article tells you how to disable or reset\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"internet options - connnections tab - proxy server","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/06\/inetcpl-proxy-server.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5884,"url":"https:\/\/www.winhelponline.com\/blog\/cancel-stuck-print-job-queue-clearing-spool-folder\/","url_meta":{"origin":339,"position":2},"title":"How to Cancel or Delete a Stuck Print Job and Clear Paper Jam","author":"Ramesh","date":"November 4, 2017","format":false,"excerpt":"Everyone would have experienced this. When printing documents, the printer may get stuck in the middle for some reason or the other. This also causes the print job to get stuck in the queue, and canceling the jobs via Printer properties doesn't help. Even if you switch off your printer\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"cancel all print job documents","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/spooler-print-jobs-queue-cancel.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/spooler-print-jobs-queue-cancel.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/spooler-print-jobs-queue-cancel.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/spooler-print-jobs-queue-cancel.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":75948,"url":"https:\/\/www.winhelponline.com\/blog\/firewall-error-0x8007045b-0x8007042c\/","url_meta":{"origin":339,"position":3},"title":"How to Fix Windows Firewall Errors 0x8007045b and 0x8007042c","author":"Ramesh","date":"July 14, 2024","format":false,"excerpt":"When you attempt to start, stop, or reset the Windows Defender Firewall, the error code 0x8007045b or 0x8007042c may appear: Windows could not stop the Windows Firewall service on Local Computer. The service did not return an error. This could be an internal Windows error or an internal service error.\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"firewall error 0x8007045b or 1068","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/defender-firewall-1068.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/defender-firewall-1068.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/defender-firewall-1068.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/defender-firewall-1068.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1294,"url":"https:\/\/www.winhelponline.com\/blog\/fix-ics-error-null-80004005-windows-7\/","url_meta":{"origin":339,"position":4},"title":"Fix Internet Connection Sharing Error Null or 80004005 in Windows 7","author":"Ramesh","date":"December 20, 2013","format":false,"excerpt":"When you try to enable Internet Connection Sharing in your Windows 7 computer via your network connection properties, one of the following errors may occur:An error occurred when enabling internet connection sharing. (null)-or-Cannot enable shared access.Error 0x80004005: Unspecified errorTo resolve the problem, make sure that the following services are started\u2026","rel":"","context":"In &quot;Windows 7&quot;","block_context":{"text":"Windows 7","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-7\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived2\/w7-ics-err-5.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":75564,"url":"https:\/\/www.winhelponline.com\/blog\/how-to-fix-error-0x80073d0a-in-microsoft-store\/","url_meta":{"origin":339,"position":5},"title":"How to Fix Error 0x80073D0A in Microsoft Store","author":"Ramesh","date":"June 16, 2024","format":false,"excerpt":"When you install apps in the Microsoft Store, the error code 0x80073D0A may appear. App installation failed with error message: error 0x80073D0A: Failed to install package\u00a0<package name> because the firewall service is not running. Ensure that the firewall service is enabled and started. (0x80073d0a) ERROR_INSTALL_FIREWALL_ SERVICE_NOT_RUNNING 0x80073D0A The package couldn't\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"store error 0x80073d0a - firewall service disabled 0x80070422","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/06\/0x80070422-firewall-service.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/06\/0x80070422-firewall-service.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/06\/0x80070422-firewall-service.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/06\/0x80070422-firewall-service.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=339"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/339\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}