专门为新手写下的,以方便新手查询常见dos命令帮助信息:- @echo off&color 1f&setlocal enabledelayedexpansion
- :begin
- cls&set "n=0"
- for /f "skip=1" %%i in ('help^|findstr /i "[a-z]"') do (
- set /a n+=1&set "_!n!=%%i"
- set /a m=!n!%%5
- if !n! neq 1 if !m! equ 1 echo.
- if !n! lss 10 (
- set "str= !n! %%i "
- ) else (
- set "str=!n! %%i "
- )
- set /p=!str:~,10! <nul
- )
- set "select="&echo.&echo.&set /p select=请选择要读取帮助的命令序号:
- echo %select%|findstr "[^0-9]">nul&&goto wrong
- if %select% lss 1 goto wrong
- if %select% gtr 71 goto wrong
- set "str=!_%select%!"
- cls&%str% /?|more
- set "choice="&echo.&set /p choice=是否继续读取其他命令帮助信息(y/n):
- if /i "%choice%" equ "y" (goto begin) else (goto :eof)
- :wrong
- echo.&echo 错误,无选择或选择不正确&ping /n 2 127.1>nul&goto begin
复制代码
|