- @echo off
- setlocal enabledelayedexpansion
- for /f %%i in ('echo;prompt $h^|cmd') do set "b=%%i"
- for /f "delims=U" %%i in ('cmd/u/c echo;唉') do set "t=%%i"
- set "s= "
- for /l %%a in (1,1,62) do set "bs=!bs!!b!"
-
- set c1=选项1
- set c2=选项2
- set c3=选项3
- set c4=选项4
- set cn=4
- set /a i=cn*1000
- set mod=0
-
- :l
- if %mod%==0 (echo;[%c1%]) else echo;%c1%%s%
- if %mod%==1 (echo;[%c2%]) else echo;%c2%%s%
- if %mod%==2 (echo;[%c3%]) else echo;%c3%%s%
- if %mod%==3 (echo;[%c4%]) else echo;%c4%%s%
-
- for /f %%i in ('powershell "[Console]::ReadKey(1).key"') do (
- if /i %%i neq enter (
- if /i %%i==uparrow set /a i-=1
- if /i %%i==downarrow set /a i+=1
- set/a mod=i%%cn
- 2>nul echo;!t!!bs! &set /p=!b!<nul
- goto :l
- )
- )
- echo %mod%
- pause
复制代码 我也来学习模仿一个。 |