Close the port in windows machine
In this post i am show the code from the how to close the ports in windows from the vbs script and batch file programming .
In the below post you can try at your own risk and enjoy programming .
—–> VBS Script
set ss = createobject(“wscript.shell”)
set ws = wscript
PORT = InputBox(“Enter the port you wish to close:”)
ss.sendkeys “firewall delete portopening TCP ” & PORT
Note : In this above post you can copy and paste from the notepad and save this file from the .vbs and run at your own risk .
——-> Batch File programming
title Port Closer
echo Port Closer
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.
Note : In this above post you can copy and paste from the notepad and save this file from the .bat and run at your own risk.