0

I have the following:

w:\encoded\mp4\movie-1
                      \title00.mp4
                      \title01.mp4 
                      \title02.mp4
              \movie-2
                      \title00.mp4
                      \title01.mp4
                      \title02.mp4
                      \title03.mp4
              \movie-7
                      \title00.mp4
                      \title01.mp4
                      \cover.jpg
              \movie-21
                      \title00.mp4
                      \title01.mp4

etc. I want to basically MOVE all the sub-folders and any files/folders in them UP one level or even to another folder entirely.

So it looks like this:

w:\encoded\movie-1
                  \title00.mp4
                  \title01.mp4 
                  \title02.mp4
          \movie-2
                  \title00.mp4
                  \title01.mp4
                  \title02.mp4
                  \title03.mp4
          \movie-7
                  \title00.mp4
                  \title01.mp4
                  \cover.jpg
          \movie-21
                  \title00.mp4
                  \title01.mp4

Any ideas would be greatly appreciated!

2
  • 1
    Windows Explorer > Select Subdirs > Cut > Click in destination dir > Paste
    – DavidPostill
    Commented May 12, 2019 at 16:19
  • In a batch file for /d %%A in (W:\encoded\mp4\*) do move "%%A" "%%~dpA.."
    – LotPings
    Commented May 12, 2019 at 16:28

2 Answers 2

0

LotPings is correct in that a For loop of folders can accomplish this. Since you asked to move them up one folder or potentially to a different folder entirely, I've fleshed it out a little bit with some variables to make it easier to change:

@echo off

set "src=W:\encoded\mp4"
set "des=W:\encoded"

for /d %%A in (%src%\*) do (
    move "%%A" "%des%"
)

It's essentially the same For loop, but you have a variable for your source (src) directory and your destination (des) directory in case you want to change them.

0

You can use robocopy

The /E flag includes empty directories, if you don't want to include them, use the /S flag.

robocopy <source> <destination> /E /MOVE
robocopy w:\encoded\mp4\ w:\encoded\ /E /MOVE

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .