Something I put together quickly; no time to test extensively right now:
@echo off for /f "delims=" %%d in ('dir /b/ad-s-h') do ( if exist "%%d\Files" ( pushd "%%d\Files" if exist *.avi move *.avi .. if exist *.mkv move *.mkv .. if exist *.mp4 move *.mp4 .. popd rd "%%d\Files" ) )
If you run it in C:\, it will look at each top-level folder on the drive and if it contains a Files sub-folder, it will move any AVI/MKV/MP4 files found up one level (i.e. to the top-level folder), then delete the Files sub-folder.
If any other files exist in Files the folder will not be deleted. You can use rd /s /q
if you want to forcibly delete. Also, move will prompt you each time to overwrite duplicates (if any), which can be done automatically by using move /y
instead.