- @echo off
- setlocal enabledelayedexpansion
- set drive=0
- for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=3" get name') do (
- set /a drive+=1
- set drive[!drive!]=%%i
- )
- set /a drive-=1
- set var=1
- :drivechoose
- echo.
- set /p output=请选择安装磁盘(<nul
- for /l %%i in (1,1,!drive!) do (
- call set /p output=%%drive[%%i]::=%%/<nul)
- echo
- )
- set /p enter=请输入安装磁盘:
- for /l %%i in (1,1,!drive!) do (
- set str=!drive[%%i]:~0,1!
- if /i "!enter!"=="!str!" (
- set var=0
- )
- )
- if %var%==1 (goto :drivechoose)
- echo ............
- pause
复制代码
|