使用系统变量,代替硬编码C盘

This commit is contained in:
bin456789 2023-06-21 23:27:42 +08:00
parent a2eb0b6ec6
commit c3cbef6a47
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -1,2 +1,3 @@
set C=%SystemDrive:~0,1%
for /f "tokens=2" %%a in ('echo list vol ^| diskpart ^| findstr /i "installer"') do (echo select disk 0 & echo select vol %%a & echo delete partition) | diskpart
for /f "tokens=2" %%a in ('echo list vol ^| diskpart ^| findstr "\<C\>"') do (echo select disk 0 & echo select vol %%a & echo extend) | diskpart
for /f "tokens=2" %%a in ('echo list vol ^| diskpart ^| findstr "\<%C%\>"') do (echo select disk 0 & echo select vol %%a & echo extend) | diskpart