echo 正在检测您系统中的可移动设备
setlocal enabledelayedexpansion
for /f "skip=1 tokens=1,2 delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set genre=%%i
set genre=!genre:~-2!
for %%a in (!genre!) do (
fsutil fsinfo drivetype %%a | findstr "移动" >nul 2>nul && if /i not "%%a"=="A:" (
set drive=%%a
echo.
echo 找到可移动存储设备, 盘符为%%a ,请确定盘符正确性。若不正确请立即退出本程序。
echo.
echo.
echo 正在处理U盘隐藏文件...
echo.
!drive!
rem 以后出现 !drive!就表示打开U盘根目录
@echo off
for %%i in (d e f g h i j k l m n o p q r s t u v w x y z) do (
fsutil fsinfo drivetype %%i: | findstr "可移动" >nul 2>nul && (echo 你U盘盘符是:%%i: && echo 按任意键退出 && pause>nul && exit)
)
echo 没有检测到可移动磁盘。
pause>nul