- 帖子
- 345
- 积分
- 502
- 技术
- 33
- 捐助
- 0
- 注册时间
- 2021-6-19
|
@echo off
FOR /F "tokens=* delims=" %%i in ('echo lis vol^|diskpart^|find "卷"^|find /v "###"') do set "str=%%i" & call :find
cls
if %rm%a==a &goto:hide
goto:hide
:find
set v=%str:~8,1%
set l=%str:~14,1%
if "%l%"==" " goto:show
goto:eof
:show
set rm=%v%_%rm%
cmd /c "echo sel vol %v% & echo assign"|diskpart
goto:eof
:hide
if %rm%a==a goto:eof
FOR /F "tokens=1* delims=_" %%i in ('echo %rm%') do set "v=%%i" & set "rm=%%j" & label %%j:SYSTEM & call :dohide
goto:hide
:dohide
cmd /c "echo sel vol=%v% & echo remove"|diskpart
goto:eof |
|