我开始也没仔细去想,现在把我的盘符搞得乱七八糟的,呵呵
这样应该好了:
将代码放在要修改的第一个盘里执行
-
- @echo off&setlocal enabledelayedexpansion
- set temp_=ABCDEFGHIJKLMNOPQRSTUVWXYZ
- for /l %%a in (0,1,26) do if "!temp_:~%%a,1!" == "%cd:~0,1%" (set /a temp__=%%a+1)
- if /i "%cd:~0,1%" == "C" (
- for /f "tokens=1,2 delims=," %%a in (temp) do (
- for /f "delims=" %%i in ('mountvol %%a /l') do mountvol %%a /d&mountvol X: %%i
- for /f "delims=" %%j in ('mountvol %%b /l') do mountvol %%b /d&mountvol Y: %%j
- )
- erase temp,%~nx0&(echo.Done.&pause>nul)&goto :loop
- ) else (
- echo.当前:%cd:~0,1%:→X:,下一个:!temp_:~%temp__%,1!:→Y:
- echo.%cd:~0,1%:,!temp_:~%temp__%,1!:>c:\temp
- copy %0 c:\>nul&pushd c:&%~nx0
- )
- :loop
复制代码
[ 本帖最后由 lxzzr 于 2009-11-2 21:21 编辑 ] |