Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I close Windows port from Command Line?

Posted on 2010-08-24
7
Medium Priority
?
1,260 Views
Last Modified: 2012-05-10
How do I close Windows port from Command Line?
0
Comment
Question by:dennisk1718
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 200 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 200 total points
ID: 33511567
If you are on windows 7 or server2008 use use "netsh advfirewall firewall" instead.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:alexfarias
alexfarias earned 100 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 100 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 100 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

618 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