也补一个,也不用wmic了,直接一点,且盘符还好设置:
[code=BatchFile]@echo off
del c:\list.txt /f /q 2>nul
for %%i in (c: d: e: f: g: h: i:) do dir %%i\ /s /b /ad >>c:\list.txt
echo OK
pause>nul[/code]
[code=BatchFile]
@echo off
for /f "skip=2 tokens=2" %%i in ('"wmic volume where drivetype=3 get name,driveletter"') do dir /b /ad /s %%i >> dir.txt
[/code]