1

I have a bunch of pictures in a folder

C:\Users\Home\Documents\Folder1\Folder2\Folder3\Folder4

Which looks like this:

Documents:
├───Stuff
├───Music
├───Text
├───Folder1
│   └───Folder2
│        └───Folder3
│            └───Folder4
│                 └───picture1.png
│                 └───picture2.png
│                 └───picturex.png

Since Folders 1-3 have nothing but a folder in them, I'd like to delete them and move my files to:

Documents:
├───Stuff
├───Music
├───Text
├───Folder4
│   └───picture1.png
│   └───picture2.png
│   └───picturex.png

I'd like apply this to multiple folders, quickly. How could I achieve that?

1
  • If you want to do this automatically, you'll need a shell script that navigates a directory subtree, bottom up, testing the level above each current level and moving the lower level up as appropriate. This could probably be best expressed recursively. I don't do Windows (and I'm not very good at recursion), so I can't provide details.
    – Joe
    Feb 2, 2021 at 7:56

1 Answer 1

0

It is very easy to do:

Open cmd: Win+R>>type cmd>>Enter

Paste these codes:

move %userprofile%\Documents\Folder1\Folder2\Folder3\Folder4 %userprofile%\Documents\
rd %userprofile%\Documents\Folder1 /s /q

Job done.

1
  • This is even more effort than cuting, pasting and then deleting the folders by hand. I'd like to do this by selecting a folder and do this automatically to all folders inside of it if it makes sense. Jan 27, 2021 at 14:40

You must log in to answer this question.

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