0% found this document useful (0 votes)
35 views

File908 PDF

This document provides instructions for closing ports on a Windows computer using the netsh command or scripts. The netsh command "netsh firewall delete portopening TCP portnumber" can be run from the Start menu or command prompt to close a specific port. The document also includes a VBScript and batch file that prompt the user for a port number and run the netsh command to close it automatically.

Uploaded by

Steve McLaren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

File908 PDF

This document provides instructions for closing ports on a Windows computer using the netsh command or scripts. The netsh command "netsh firewall delete portopening TCP portnumber" can be run from the Start menu or command prompt to close a specific port. The document also includes a VBScript and batch file that prompt the user for a port number and run the netsh command to close it automatically.

Uploaded by

Steve McLaren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

How To Close Ports

So i've been looking for a while on just how to close a port on a computer. I simply
couldn't find a way. Well, i finally found it. This'll only work for windows users (unless
your unix version OS has netsh).

it's actually quite simple. here's the command for it:

netsh firewall delete portopening TCP portnumber

it's that simple. Simply go to START -> RUN -> and type in that command up there,
and it'll close it for you.

or, you can also open up command prompt (START -> RUN -> CMD) and type in "netsh"
without the quotes to get to your windows firewall settings.

however, since i'm such a nice guy, i wrote it all out in a vbs script for you so that it's
automatically runable. as well as a batch script. so here you are fellas:

.VBS Script

set ss = createobject("wscript.shell")
set ws = wscript
dim PORT
PORT = InputBox("Enter the port you wish to close:")
ss.run "netsh.exe"
ws.sleep 1000
ss.sendkeys "firewall delete portopening TCP " & PORT
ss.sendkeys "{enter}"
ws.sleep 500
'ss.sendkeys "exit"
'ss.sendkeys "{enter}"

.BAT Script

@echo off
title Port Closer
echo Port Closer
echo.
set /p port=Type the port number you wish to close here:
netsh firewall delete portopening TCP %port%
msg /w * Port %port% has been closed.
exit

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy