
You would simply run this command: netsh advfirewall firewall add rule name="Open Remote Desktop" protocol=TCP dir=in localport=3389 action=allow Let’s say you want to open port 3389, which is for remote desktop in Windows. Now what if you want to open a port in the firewall using the command line? That’s simple too! To enable again, just put on at the end instead of off. So if you wanted to disable the firewall completely, you would use allprofiles instead of privateprofile. The other options are currentprofile, publicprofile, domainprofile, and allprofiles.

To disable the firewall for a specific profile, you would use the following command: netsh advfirewall set privateprofile state off The Firewall Policy tells you what inbound and outbound policies are being applied to each profile. State means if the firewall is turned on or off.
