Solved

How do I close Windows port from Command Line?

Posted on 2010-08-24
7
1,116 Views
Last Modified: 2012-05-10
How do I close Windows port from Command Line?
0
Comment
Question by:dennisk1718
7 Comments
 
LVL 3

Expert Comment

by:clw3388
ID: 33511508
netsh will assist you in setting windows firewall exceptions..
http://support.microsoft.com/kb/875357
0
 
LVL 10

Accepted Solution

by:
jorlando66 earned 50 total points
ID: 33511532
From command line

To view ports open through the Windows Firewall
netsh firewall show portopening

To open a specific port from the command line
netsh firewall add

To close a specific port form the command line:
netsh firewall delete
0
 
LVL 10

Assisted Solution

by:jorlando66
jorlando66 earned 50 total points
ID: 33511567
If you are on windows 7 or server2008 use use "netsh advfirewall firewall" instead.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 3

Assisted Solution

by:alexfarias
alexfarias earned 25 total points
ID: 33511597
See if that helps. Just replace "enable the" disable "and Appends the port you want. Save the file as. Bat

@echo Enabling HTTP port 80
netsh firewall set portopening TCP 80 "HTTP"
@echo Enabling SSL port 443
netsh firewall set portopening TCP 443 "SSL"
@echo Enabling port for SQL Server Browser Service's 'Browse' Button
netsh firewall set portopening UDP 1434 "SQL Browser"
@echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)
netsh firewall set multicastbroadcastresponse ENABLE
0
 
LVL 3

Expert Comment

by:alexfarias
ID: 33511616
See if that helps. Just replace "enable" for "disable" and Appends the port you want. Save the file as. Bat

@echo =========  disabling unused ports  ==============
@echo Enabling HTTP port 80
netsh firewall set portopening TCP 80 "HTTP"
@echo Enabling SSL port 443
netsh firewall set portopening TCP 443 "SSL"
@echo Enabling port for SQL Server Browser Service's 'Browse' Button
netsh firewall set portopening UDP 1434 "SQL Browser"
@echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)
netsh firewall set multicastbroadcastresponse ENABLE
0
 
LVL 23

Assisted Solution

by:Stelian Stan
Stelian Stan earned 25 total points
ID: 33511654
If you want to close port 139

netsh firewall delete portopening TCP 139
0
 
LVL 12

Assisted Solution

by:kadafitcd
kadafitcd earned 25 total points
ID: 33511661
Here's a link for a more in depth look at the netsh commands:  http://technet.microsoft.com/en-us/library/bb490617.aspx

Good Luck HTH.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of: 192.168.0.1, 192.168.1.1, 192.168.11.1, …
Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question