Batch Processing of the CMD command quick query manual created on the Internet

Source: Internet
Author: User

Online demonstration: CMD command quick query manual Copy codeThe Code is as follows: @ echo off & setlocal EnableDelayedExpansion
Echo. ==========================================================
Echo starts to create the CMD command quick query manual. Please wait ......
Echo creates a webpage file header ......
> CMDHelp.htm echo ^ > CMDHelp.htm echo ^ <title ^> CMD command quick query manual ^ </title ^>
> CMDHelp.htm echo ^ <meta http-equiv = "Content-Type" content = "text/html ^; charset = gb2312" ^/^>
> CMDHelp.htm echo ^ > CMDHelp.htm echo ^ <a name = "Top" ^>
> CMDHelp.htm echo ^ <center ^> ^

> CMDHelp.htm echo ^ <table ^>

Echo creates a help directory ......
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 ^> ^ <td ^> ^ <a href = "#! Name! "^>! Name! ^ </A ^> ^ </td ^> ^ <td ^> ^! Desc!> CMDHelp.htm
)
> CMDHelp.htm echo ^ </td ^> ^ </tr ^> ^ </table ^> ^ <br ^> ^ <a href = "# top" ^> Back to top ^ </a ^> ^ <br ^>

Echo creates the help body ......
Cscript // h: cscript // B
For/f % I in ('help ^ | findstr "^ [A-Z]" ') do (
> CMDHelp.htm echo ^ <a name = "% I" ^> ^

Echo is creating the help body of % I ......
If/I "% I" = "SC" echo Press Y to continue ......
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" ^> Back to top ^ </a ^> ^ <br ^>
)

Echo CMD command quick query manual is created. Open any key
Echo. ==========================================================
Pause> nul & start CMDHelp.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.