开发者

Move Wildcard Folder structure files to a destination folder

开发者 https://www.devze.com 2023-03-15 03:04 出处:网络
I want to move all the folders starting with \"Temp_*****\" to a different folder. It does not seem like we c开发者_JAVA技巧an use wild card with Folders. I was looking online, and someone posted this

I want to move all the folders starting with "Temp_*****" to a different folder. It does not seem like we c开发者_JAVA技巧an 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


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号