Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- Setlocal EnableDelayedExpansion
- SET ROOT_FOLDER=C:TEST 1
- SET TARGET_FOLDER=C:TEST 2
- FOR /D %%G IN ("%ROOT_FOLDER%"*) do (
- CD %%G
- FOR /f %%A in ('dir ^| find "File(s)"') do (
- set cnt=%%A
- Echo %%G : !cnt!
- IF !cnt! == 1 (
- move /-y "*.*" "%TARGET_FOLDER%"
- )
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement