Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for netshhelp.bat

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

  1. @ECHO OFF
  2. IF NOT "%OS%"=="Windows_NT" GOTO Syntax
  3. IF NOT  "%~1"==""           GOTO Syntax
  4.  
  5. SETLOCAL ENABLEDELAYEDEXPANSION
  6. FOR /F "tokens=5" %%A IN ('FILEVER %windir%\system32\netsh.exe') DO SET NETSHVer=%%A
  7. ECHO NETSH, Version %NETSHVer%
  8. ECHO.
  9. NETSH /?
  10. FOR /F "tokens=7 delims=' " %%A IN ('NETSH /? ^| FINDSTR /R /C:"netsh .* context."') DO (
  11. 	CALL :UpCase %%A
  12. 	ECHO.
  13. 	ECHO The following commands are available in the NETSH !context! context:
  14. 	ECHO.
  15. 	NETSH %%A /? | MORE +4 | FINDSTR /R /B /C:"[\?a-z][a-z ]*-"
  16. )
  17. ENDLOCAL
  18. GOTO:EOF
  19.  
  20.  
  21. :UpCase
  22. SET context=%1
  23. SET context=%context:a=A%
  24. SET context=%context:b=B%
  25. SET context=%context:c=C%
  26. SET context=%context:d=D%
  27. SET context=%context:e=E%
  28. SET context=%context:f=F%
  29. SET context=%context:g=G%
  30. SET context=%context:h=H%
  31. SET context=%context:i=I%
  32. SET context=%context:j=J%
  33. SET context=%context:k=K%
  34. SET context=%context:l=L%
  35. SET context=%context:m=M%
  36. SET context=%context:n=N%
  37. SET context=%context:o=O%
  38. SET context=%context:p=P%
  39. SET context=%context:q=Q%
  40. SET context=%context:r=R%
  41. SET context=%context:s=S%
  42. SET context=%context:t=T%
  43. SET context=%context:u=U%
  44. SET context=%context:v=V%
  45. SET context=%context:w=W%
  46. SET context=%context:x=X%
  47. SET context=%context:y=Y%
  48. SET context=%context:z=Z%
  49. GOTO:EOF
  50.  
  51.  
  52. :Syntax
  53. ECHO.
  54. ECHO NETSHHelp.bat,  Version 1.00
  55. ECHO Display help for NETSH and all its subcontexts
  56. ECHO.
  57. ECHO Usage:  NETSHHELP
  58. ECHO.
  59. ECHO Written by Rob van der Woude
  60. ECHO http://www.robvanderwoude.com
  61.  
  62. IF "%OS%"=="Windows_NT" EXIT /B 1
  63.  

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