我原来写的一段代码:- :IsGPT
- rem 判定是否是GPT磁盘。
- echo list disk >yiwuyun.txt
- for /f "skip=8 tokens=3 delims=B" %%k in ('diskpart /s yiwuyun.txt') do (
- set temp=%%k
- if "!temp:~8,1!"=="*" goto gpt
- )
- set gpt=false
- echo Your disk is MBR disk!
- goto nogpt
- :gpt
- set gpt=true
- echo Your disk is GPT disk!
- :nogpt
- if exist yiwuyun.txt del yiwuyun.txt || exit /b 1
- rem echo errorlevel is !errorlevel!
- exit /b 0
复制代码
|