Quantcast
Channel: Security forum
Viewing all articles
Browse latest Browse all 12072

NETSH firewall add ------------ duplicate entries?????

$
0
0

I have a question about the NETSH command and firewalls.. ... Anyone elese can chime also... thanks!

I have a script that i found on the net.. Bascially i'm having trouble with duplicate netries being made on the server when the firewall rulz are added.... By the looks  of the script below, i'm assuming that it checks for the entry it already exists....

Any help is appreciated.....   Thanks!!!  ^_^

 

@ECHO OFF
REM  ----------------------------------------
REM  6. Windows XP FireWall: open Port 3306 for MySQL-database.

REM  skip Windows 2000
ver | find /I "Windows XP" > nul
if ERRORLEVEL 1 Goto Terminate

REM  ...in Windows XP SP1 firewall does not exist.
netsh.exe help | find /I "firewall" > nul
if errorlevel 1 Goto Terminate

REM  try to open the port
netsh.exe firewall add portopening protocol=TCP port=3306 name=MySQL > nul
if errorlevel 1 Goto Step6Error
ECHO Step 6 Windows XP FireWall: Port 3306 for MySQL-database opened.
Goto Terminate

REM  ErrorHandling
:Step6Error
ECHO Step 6 Windows XP FireWall: Error while opening Port 3306 for MySQL-database !
Goto Terminate

:Terminate
REM  ----------------------------------------


Viewing all articles
Browse latest Browse all 12072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>