![]() 支柱会员
|
net /?
net view /help 查看太烦,倒腾个手册玩玩 保存为make.cmd运行 代码:
@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 此帖于 2005-07-30 13:10:53 被 hitme 编辑. . |
||
![]() 核心会员
|
顶好用。不知道其他的可不可以这样做?
|
||
![]() 你太有才了.- -| |
![]() 支柱会员
|
引用:
http://bbs.et8.net/bbs/showthread.php?p=5929863 构造net命令手册要复杂些。。费了些时间 此帖于 2005-07-03 15:17:24 被 hitme 编辑. . |
|||
![]() 支柱会员
|
编写过程遇到如下困难:
1.net help输出命令名字有3列,不容易抓,还有些杂项干扰 2.net xxx /help输出帮助信息,抓回来居然是unix换行,想办法啊想办法,试了个出来 代码:
%%i /help|find /n /v "."|more +3 |
||