I happened to find this bat file on my personal HDD. I do not remember where did I find it.
This is a very simple way to close a port on a Windows XP machine if you happen to use the Windows Firewall. We have two versions of the script. This script is not ours. It is a work of some person we do not know! Copyright to him.
Ofcourse, this will work only with Windows Firewall on Windows XP. I do not have a Windows Vista or Seven to test it on. If you do test and it does work on it, please let us know. This is a .bat.
@echo off title Port Closer echo Port Closer echo ============ echo. set /p port=Type the port number you wish to close here: netsh firewall delete portopening TCP %port% exit
This does not perform any type of error checking to see if the port is actually closed or not. We also have a .vbs version of the same.
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 500These are simple scripts you might want to use to close on your Windows XP machines.
Searches leading to this post:close port windows xp, release port windows xp, batch close network port, close windows xp ports, closing ports in windows xp, netsh close port, netsh close ports
