Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for addmysqlport.bat

(view source code of addmysqlport.bat as plain text)

  1. @ECHO OFF
  2. REM Written by Willi Huber
  3. REM w.huber@sonplas.de
  4.  
  5. REM  ----------------------------------------
  6. REM  6. Windows XP FireWall: open Port 3306 for MySQL-database.
  7.  
  8. REM  skip Windows 2000
  9. ver | find /I "Windows XP" > nul
  10. if ERRORLEVEL 1 Goto Terminate
  11.  
  12. REM  ...in Windows XP SP1 firewall does not exist.
  13. netsh.exe help | find /I "firewall" > nul
  14. if errorlevel 1 Goto Terminate
  15.  
  16. REM  try to open the port
  17. netsh.exe firewall add portopening protocol=TCP port=3306 name=MySQL > nul
  18. if errorlevel 1 Goto Step6Error
  19. ECHO Step 6 Windows XP FireWall: Port 3306 for MySQL-database opened.
  20. Goto Terminate
  21.  
  22. REM  ErrorHandling
  23. :Step6Error
  24. ECHO Step 6 Windows XP FireWall: Error while opening Port 3306 for MySQL-database !
  25. Goto Terminate
  26.  
  27. :Terminate
  28. REM  ----------------------------------------
  29.  

page last modified: 2024-04-16; loaded in 0.0048 seconds