当前位置: 移动技术网 > IT编程>网络>Dos/Bat > 在网上找的创建《CMD命令速查手册》的批处理

在网上找的创建《CMD命令速查手册》的批处理

2017年12月12日  | 移动技术网IT编程  | 我要评论
在线演示:cmd 命令速查手册
复制代码 代码如下:

@echo off & setlocal enabledelayedexpansion
echo.========================================
echo 开始创建《cmd命令速查手册》,请稍候……
echo 创建网页文件头……
>cmdhelp.htm echo ^<head^>
>>cmdhelp.htm echo ^<title^>cmd命令速查手册^</title^>
>>cmdhelp.htm echo ^<meta http-equiv="content-type" content="text/html^; charset=gb2312" ^/^>
>>cmdhelp.htm echo ^</head^>
>>cmdhelp.htm echo ^<a name="top"^>
>>cmdhelp.htm echo ^<center^>^<h1^>cmd 命令速查手册^</h1^>%username% - %date%^</center^>^<br^>
>>cmdhelp.htm echo ^<table^>

echo 创建帮助目录……
for /f "delims=:" %%f in ('help^|findstr /n "^assoc"') do set head=%%f
set /a head-=1
if "%head%"=="0" (set head=) else set head=skip=%head%
for /f "%head% delims=" %%i in ('help') do (
set str=%%i & set name=!str:~0,9! & set desc=!str:~9!
echo.!name! | findstr /v "^[a-z]" >nul && echo !desc! >>cmdhelp.htm
if errorlevel 1 echo ^</td^>^</tr^>^<tr^>^<td^>^<a href="#!name!"^>!name!^</a^>^</td^>^<td^>^ ^ ^ !desc!>>cmdhelp.htm
)
>>cmdhelp.htm echo ^</td^>^</tr^>^</table^>^<br^>^<a href="#top"^>返回页首^</a^>^<br^>

echo 创建帮助正文……
cscript //h:cscript //b
for /f %%i in ('help^|findstr "^[a-z]"') do (
>>cmdhelp.htm echo ^<a name="%%i"^>^<h2^>%%i^</h2^>^<pre^>
echo 正在创建 %%i 的帮助正文中……
if /i "%%i"=="sc" echo 请按y键继续……
help %%i | findstr "<.*>" >nul
if not errorlevel 1 (
for /f "delims=" %%a in ('help %%i') do (
set st=%%a & set st=!st:^<=^<! & set st=!st:^>=^>!
echo !st!>> cmdhelp.htm
)
) else help %%i>>cmdhelp.htm
>>cmdhelp.htm echo ^</pre^>^<a href="#top"^>返回页首^</a^>^<br^>^<br^>
)


echo 《cmd命令速查手册》创建完毕,任意键打开
echo.========================================
pause>nul && start cmdhelp.htm

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网