您的位置:首页 > 其它

cmd脚本构造htm文件-----Net 命令速查手册

2008-10-21 21:15 363 查看
@echo off

del net_help.htm 2>nul

echo.===============================

echo......请稍候,构造htm文件中.....

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^; charset=gb2312" ^/^>

>>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 Written by Hitme

>>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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: