Ventoy Forums
Solved 隐藏EFI盘符 Hidden EFI volume - Printable Version

+- Ventoy Forums (https://forums.ventoy.net)
+-- Forum: Ventoy General Use —— Ventoy 使用交流 (https://forums.ventoy.net/forumdisplay.php?fid=1)
+--- Forum: Ventoy Discussion Forum (https://forums.ventoy.net/forumdisplay.php?fid=2)
+--- Thread: Solved 隐藏EFI盘符 Hidden EFI volume (/showthread.php?tid=2568)



隐藏EFI盘符 Hidden EFI volume - 塞北的雪 - 07-18-2023

每次看到EFI盘符很不爽,想着隐藏掉,以下保存为批处理.bat格式,右键,管理员身份运行
save to .bat and run as admin

Code:
@echo off
setlocal enabledelayedexpansion
if exist %temp%\ventoy_vol.txt (
    del %temp%\ventoy_vol.txt
)
if exist %temp%\ventoy_diskpart_cmd.txt (
    del %temp%\ventoy_diskpart_cmd.txt
)
echo list volume >%temp%\ventoy_diskpart_cmd.txt
diskpart /s %temp%\ventoy_diskpart_cmd.txt |findstr /i VTOYEFI >%temp%\ventoy_vol.txt
echo Find Volume:
type %temp%\ventoy_vol.txt
for /f "tokens=1,2,3" %%a in (%temp%/ventoy_vol.txt) do (
    set "volumeNumber=%%b"
    set "volumeLetter=%%c"
    echo volumeNumber: !volumeNumber!
    echo volumeLetter: !volumeLetter!
)
if "!volumeNumber!" EQU "" (
    echo 未找到目标卷标编号,即将退出 volumeNumber not found
    ping -n 5 127.0.0.1>nul
    exit
)
if "!volumeLetter!" EQU "" (
    echo 未找到目标驱动器号,即将退出 volumeLetter not found
    ping -n 5 127.0.0.1 >nul
    exit
)
rem echo select volume !volumeNumber!
rem echo remove letter=!volumeLetter!
echo select volume !volumeNumber! >%temp%\ventoy_diskpart_cmd.txt
echo remove letter=!volumeLetter! >>%temp%\ventoy_diskpart_cmd.txt
diskpart /s %temp%\ventoy_diskpart_cmd.txt
echo 隐藏完毕 Done.
del %temp%\ventoy_diskpart_cmd.txt
del %temp%\ventoy_vol.txt

save to delete_volume_with_label.bat or what you like.


RE: 隐藏EFI盘符 Hidden EFI volume - nguyen ha thai trong - 07-19-2023

excellent