在網上找的建立《CMD命令速查手冊》的批處理

來源:互聯網
上載者:User

線上示範: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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.