來源:不明


將以下文字複製貼上另存新檔(*.cmd or *.bat)後直行即可

###########################################################
@echo off
del net_help.htm 2>nul
echo.===============================
echo......請稍候,建構文件中.....
echo.===============================
setlocal  ENABLEDELAYEDEXPANSION
for /f "tokens=1,2 delims=:" %%i in ('net help^|more +9^|findstr /n "."') do (
                set n=%%j           
                if %%i gtr 0 (if %%i lss 10 (
                        echo !n:~3,22!>>tmp.txt
                        echo !n:~28,14!>>tmp.txt
                        echo !n:~50,14!>>tmp.txt
                )
                )           
)

for /f "delims=" %%i in ('sort tmp.txt') do (
            set x=%%i
            set x=!x: =!
            set x=!x:CONFIGWORKSTATION=CONFIG WORKSTATION!
            set x=!x:CONFIGSERVER=CONFIG SERVER!
            set x=!x:NET=NET !
            echo !x!>>tmp1.txt
)

endlocal

 >net_help.htm echo ^<head^>
>>net_help.htm echo ^<title^>Help for Net commands^</title^>
>>net_help.htm echo ^<meta http-equiv="Content-Type" content="text/html^" ^/^>
>>net_help.htm echo ^</head^>
>>net_help.htm echo ^<A NAME="Top"^>
>>net_help.htm echo ^<center^>
>>net_help.htm echo ^<h1^>Net 命令速查手冊^</h1^>
>>net_help.htm echo ^</center^>

for /f "delims=" %%i in (tmp1.txt) do (
            >>net_help.htm echo ^<a href="#%%i"^>%%i^</a^>
            >>net_help.htm echo ^</br^>
)

for /f "delims=" %%i in (tmp1.txt) do (
            >>net_help.htm echo ^<a name="%%i"^>
            >>net_help.htm echo ^<h2^>%%i^</h2^>
            >>net_help.htm echo ^<pre^>
            %%i /help|more /s>>net_help.htm
            >>net_help.htm echo ^</pre^>
            >>net_help.htm echo ^<a href="#top"^>返回首頁^</a^>
)
del tmp*.txt
start net_help.htm
###########################################################

Posted by firewolf241 at 痞客邦 PIXNET Comments(0) Trackback(0) Hits(11)