问题
I want to move all the folders starting with "Temp_*****" to a different folder. It does not seem like we can use wild card with Folders. I was looking online, and someone posted this piece of code but I'm not sure how to apply it to my scenario.
@echo off for /d %%a in ({*}) do xcopy "%%a" "C:\Home\a\b\tmp\%%a\" /E
回答1:
Here's one way to do it, replace C:\TEST01\ with your source folder location:
for /F %%a in ('dir C:\TEST01\TEMP_* /ad /b') do move C:\TEST01\%%a C:\Home\a\b\tmp\%%a
来源:https://stackoverflow.com/questions/6455081/move-wildcard-folder-structure-files-to-a-destination-folder