想弄一个批处理,自动搜索文件夹并删除!
发布网友
发布时间:2024-10-24 03:56
我来回答
共2个回答
热心网友
时间:2024-11-02 16:32
@echo off
setlocal enabledelayedexpansion
for /r C:\ %%a in (123) do (
set "u=%%a"
for /f "delims=\ tokens=2 usebackq eol=?" %%b in ('echo !u!') do (
set "u1=%%b"
)
if exist "!u!" rd /s /q "C:\!u1!"
)
for /r D:\ %%a in (123) do (
set "u=%%a"
for /f "delims=\ tokens=2 usebackq eol=?" %%b in ('echo !u!') do (
set "u1=%%b"
)
if exist "!u!" rd /s /q "D:\!u1!"
)
for /r E:\ %%a in (123) do (
set "u=%%a"
for /f "delims=\ tokens=2 usebackq eol=?" %%b in ('echo !u!') do (
set "u1=%%b"
)
if exist "!u!" rd /s /q "E:\!u1!"
)
for /r F:\ %%a in (123) do (
set "u=%%a"
for /f "delims=\ tokens=2 usebackq eol=?" %%b in ('echo !u!') do (
set "u1=%%b"
)
if exist "!u!" rd /s /q "F:\!u1!"
)
热心网友
时间:2024-11-02 16:35
在DOS下,用DELTREE/y命令试试看, 慎用!!