|
- @ECHO OFF
- :BEGIN
- CLS
- set AskVolume=
- Set /P AskVolume=请输入您要查询的分区的卷标:
- If "AskVolume%AskVolume%"=="AskVolume" GOTO BEGIN
- cd.>script.txt
- >>script.txt echo list volume
- for /f "tokens=3,4" %%i in ('diskpart /s script.txt^|find ^"Software^"') do Set PartitionNum=%%i&&SET AskVolume=%%j
- del script.txt /q
- echo 您所查询的卷标为 %AskVolume% 的分区为:%PartitionNum%
- pause
复制代码 |
|