Netsh — lets add/open port in Windows firewall

Lets assume we need to open port 5900 for RealVNC application:

1. open command line console by typing cmd.exe in the START/RUN

2. lets issue the command at the prompt C:>

3. netsh firewall add portopening TCP 5900 VNC

Once the command is completed, lets issue another command to see what we have done 🙂

netsh firewall show state

This will show/output on your screen stae of your Windows firewall and what ports ar eopen and application allowed

We can easy to use the command in script or batch file to open bunch of ports for our internal use on client machine and also can be used to close the ports if needed.

Leave a Reply