10 July 2012

CLOSE PORT TO STOP SOME WINDOWS SERVICES

SOLUTION:-
Sometimes there are some programs that uses ports to get run properly.and also they uses memory,internet speed.so here's a simply tricks with which you can close the port to save unusual running of programs and save a bit memory.
  • Simply go to START -> RUN -> and type this in the box 
netsh firewall delete portopening TCP portnumber
and it'll close it for you.

OR

  • You can also open up command prompt START -> RUN -> CMD and type in netsh to get to your windows firewall settings.

  • vbs script for you so that it's automatically runnable. as well as a batch script. so here's the script.
.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

NOTE:- To create any script simply open notepad and past the script in it and while saving the notepad file save it as .vbs or .bat.remember the extension.

thank you :)

No comments:

Post a Comment