Move Wildcard Folder structure files to a destination folder

妖精的绣舞 提交于 2020-01-15 10:41:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!