回复 1# 986981535
这个是我自用的版本,比如当前有多个硬盘的时候,C盘卷标是“系统”,自动将剩余空间分配给D盘。- @echo off & setlocal enabledelayedexpansion
- cd /d "%~dp0"
- for /f "tokens=2" %%a in ('echo list volume ^| diskpart ^|find/i "系统" ^| find /i "启动"') do set nc=%%a
- set /a nd=nc+1
- echo select volume %nd% >scriptname.txt
- echo extend noerr >>scriptname.txt
- echo 当前待扩展分区编号为:%nd%
- diskpart /s "scriptname.txt"
- if exist diskname.dll (del diskname.dll)
- if exist list.dll (del list.dll)
- exit
复制代码
|