|
- @echo off
- for /f "tokens=2 delims==" %%i in ('"wmic LogicalDisk where DriveType=2 get DeviceID /value 2>nul"') do echo U盘盘符 %%i
- for /f "tokens=2 delims==" %%a in ('"wmic DiskDrive where MediaType="External hard disk media" get Index /value 2>nul"') do (
- for /f "tokens=7 delims== " %%i in ('wmic path Win32_LogicalDiskToPartition^|findstr /c:"Disk #%%a"') do (
- echo 移动硬盘盘符 %%~i
- )
- )
- pause>nul
复制代码 |
|