|
本帖最后由 baby1277 于 2024-12-8 19:23 编辑
- @echo off
- for /f "tokens=3 delims=" %%i in ('echo LIST VDISK^|diskpart') do set s1=%%i
- if defined s1 set vhd=yes
- setlocal enabledelayedexpansion
- for /f "tokens=2,3" %%i in ('echo LIST VOLUME^|diskpart') do if "%%j"=="%SystemDrive:~0,1%" set s2=%%i
- if "%s1:~-1%"=="!s2!" set vhd=yes
- setlocal disabledelayedexpansion
- if defined vhd echo 本系统为VHD系统
- if not defined vhd echo 本系统不是VHD系统
- pause
复制代码 |
|