如何编写一个搜索并复制粘贴某文件夹的BAT
发布网友
发布时间:2022-05-05 05:39
我来回答
共1个回答
热心网友
时间:2023-10-11 08:49
@echo off&setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "驱动器">nul&&set "q=!q! !drive!"&&fsutil fsinfo drivetype !drive!|find "可移动">nul&&call :ca !drive! "!q!"
)
pause
:ca
for %%a in (%~2) do for /f "delims=" %%i in ('dir /ad /b /s %%a:\SS') do xcopy "%%i" %1
goto :eof