回复 6# friendtasy - @echo off
- >"%temp%\script1.txt" (
- echo select disk=0
- echo list partition
- )
- for /f "tokens=2" %%a in ('diskpart /s "%temp%\script1.txt"') do (
- set n=%%a
- )
- >"%temp%\script2.txt" (
- echo select disk=0
- echo select partition %n%
- echo detail partition
- echo exit
- )
- for /f "tokens=4" %%a in ('diskpart /s "%temp%\script2.txt"') do (
- set last=%%a
- )
- echo,%last%
- pause
复制代码
|