找到一段代码:- @echo off & setlocal enabledelayedexpansion
-
- echo 你的所有盘是如下:
-
- for /f "skip=1 delims=\" %%i in ('fsutil fsinfo
- drives^|find /v ""') do (
- set disk=%%i&set disk=!disk:~-2!
- echo.!disk!
-
- )
- pause
复制代码 如何将下面这个代码,加到上面这个代码里面呢?
rem 删除空文件夹
for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=2" get caption') do (
for /f "tokens=*" %%j in ('dir /s/ad/b %%i') do rd "%%j" 1>nul 2>nul
)
for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=3" get caption') do (
for /f "tokens=*" %%j in ('dir /s/ad/b %%i') do rd "%%j" 1>nul 2>nul
) |