本帖最后由 apang 于 2014-9-22 12:39 编辑
- @echo off
- set "volume=C_PAN"
- 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:\ if not defined Drv (
- call :Next %%a
- )
- )
- echo,%Drv%
- pause & exit/b
-
- :Next
- for /f "tokens=3*" %%a in ('dir %1:\ 2^>nul') do (
- if /i "%%b" == "%volume%" set "Drv=%1:"
- goto :eof
- )
复制代码
|