Reputation: 53
Example:
Folder tree:
C:\
|
|---lion
| |---one
| |---two
| |---three
|
|---bear
I need move subfolders (one, two, three, etc.) in the folder "bear".
I know how to find and move specific file types, but how to find and move the folders don't know:
for /R "c:\one" %%f in (*.jpg) do move /Y "%%f" "c:\two"
Upvotes: 0
Views: 99
Reputation: 41297
This should work too.
@echo off
pushd "c:\lion"
for /d %%a in (*) do move "%%a" "c:\bear"
popd
Upvotes: 0
Reputation: 37589
Try this (fixed):
for /d /r "C:\lion" %%a in (*) do md "C:\bear\%%~nxa" &robocopy /e /move "%%~fa" "C:\bear\%%~nxa"
Upvotes: 1