本帖最后由 pcl_test 于 2015-3-18 09:19 编辑
回复 7# miantouchi | @echo off | | setlocal enabledelayedexpansion | | ::适用XP/Win7/Win8/Win10 | | set drive= | | set "uname=设定不弹出的U盘卷名" | | for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do ( | | if exist %%a:\ ( | | fsutil fsinfo drivetype %%a: | find "移动" >nul && set "drive=!drive!%%a " | | ) | | ) | | | | ver | find "5.1." >nul && goto x86 | | ver | find "6." >nul && goto check | | | | :check | | if /i "%PROCESSOR_IDENTIFIER:~0,3%" == "X86" (goto x86) else (goto x64) | | :x86 | | cd /d "x86\" | | for %%i in (!drive!) do ( | | for /f "tokens=1* delims=: " %%j in ('fsutil fsinfo volumeinfo %%i: ^| find "卷名"') do ( | | if not "%%k" == "%uname%" RemoveDrive.exe %%i: | | ) | | ) | | exit | | :x64 | | cd /d "x64\" | | for %%i in (!drive!) do ( | | for /f "tokens=1* delims=: " %%j in ('fsutil fsinfo volumeinfo %%i: ^| find "卷名"') do ( | | if not "%%k" == "%uname%" RemoveDrive.exe %%i: | | ) | | ) | | exitCOPY |
|