本帖最后由 ygqiang 于 2024-7-27 11:36 编辑
[已解决]系统启动(bios或uefi)-硬盘格式(mbr或gpt),硬盘容量显示,代码如何修改?
===========其他显示功能不要改动,只要修改硬盘容量显示就行。谢谢
硬盘容量只显示一系列数字,如何修改显示为整数形式?比如:
8G、16G、32G、64G、128G、256G、512G
或者1T、2T、3T、4T、...- @fltmc>nul||mshta vbscript:CreateObject("Shell.Application").ShellExecute("%~dpnx0","%*",,"runas",1)(window.close)&&exit
- @echo off
- cd /d "%~dp0"
- cls
-
- bcdedit /enum {current} | find /i "winload.efi" && cls && echo. && echo. && (
- echo --------当前引导方式:UEFI
- ) || (
- echo --------当前引导方式:Legacy
- )
-
-
-
- @echo off
- setlocal ENABLEDELAYEDEXPANSION
-
- for /f "usebackq tokens=1,2 delims==" %%a in (` "wmic DISKDRIVE get Index,size /value"`) do (
- if "%%a" == "Index" (
- call set _Disk_List_=!_Disk_List_! %%b
- call set _Disk_ID_=%%b
- for /f "usebackq tokens=1,2 delims==" %%c in (` "wmic partition where DiskIndex=!_Disk_ID_! get Type /value"`) do (
- if "%%c" == "Type" (
- for /f "tokens=1 delims=:" %%e in ( "%%d" ) do (
- if "%%e" == "GPT" (set _Disk_!_Disk_ID_!_Type_=%%e) else (set _Disk_!_Disk_ID_!_Type_=MBR)
- )
- )
- )
- )
- if "%%a" == "Size" (
- call set _Disk_!_Disk_ID_!_Size_=%%b
- )
- )
-
- for %%a in (%_Disk_List_%) do (
- echo.
- echo -----磁盘 %%a
- echo 格式::!_Disk_%%a_Type_! 容量::!_Disk_%%a_Size_!
- echo.
- )
-
- echo.
- echo.
-
- pause >nul
复制代码
|