I need a batch file to move the files from this:
F:\123456\V000\Chaptered\File1
F:\123456\V000\Chaptered\File2
F:\123457\V000\Chaptered\File1
F:\123457\V000\Chaptered\File2
to this
F:\123456\File1
F:\123456\File2
F:\123457\File1
F:\123457\File2
while deleting the folders V000
and Chaptered
but not deleting any files.
I've tried to make a batch file in several different ways, but can't get it to work.
@echo off & setlocal enabledelayedexpansion
for /d /r %~"dp0" %%a in (*) do (
if /i "%%~nxa"=="FolderX" (
set "folderpath=%%a"
move /y "!folderpath!\*" "!folderpath!\.."
rmdir "!folderpath!"
)
)
I'd hope to achieve the file structure above, but have not been able to get anything to change. (I'm trying to be careful about what I delete as the files are important.)