1

Best would be using a .bat file. But could also be Powershell if it's easier.

Now I'm using this:

for /r "M:\movies\new\" %%x in (*.mp4) do move "%%x" "M:\movies\new\"

but this works only for one extension (.mp4). How could I do this for multiple extensions?

4
  • 1
    Possible duplicate of Batch move a folder's content up one level
    – LotPings
    Commented May 1, 2018 at 21:40
  • You can put it like this (*.*) , right?
    – DxTx
    Commented May 1, 2018 at 21:54
  • But there are also some .txt files in it which I don't want. :S
    – ttt
    Commented May 1, 2018 at 22:24
  • 1
    Use *.* and qualify the move statement: ... in (*.*) do if not %%~xx == .txt move ....
    – AFH
    Commented May 1, 2018 at 23:17

1 Answer 1

0

Windows (and MacOS plus *ix) predate the numerous extensions created to hold video. The OS just doesn't know how to tell what is a video file and what isn't, so you will need to run that command line for each extension you wish to move.

Alternatively, move the *.txt files to another directory, move everything remaining, then move *.txt back, a la

for /r "M:\movies\new\" %%x in (*.txt) do move "%%x" "M:\placeholder\"
for /r "M:\movies\new\" %%x in (*.*) do move "%%x" "M:\movies\new\"
for /r "M:\placeholder\" %%x in (*.txt) do move "%%x" "M:\original directory\"

You must log in to answer this question.

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