Help moving files up one directory level
Hi, I have about 400 folders with the following directory depth: Level1\Level2\Level3\*.files I need to move all of the *.files up one directory so that they are: Level1\Level2\*.files It would also be extremely helpful if I could limit the *.files to specific types of files, namely *.PNG and then if I could delete the "Level3" directories and any remaining junk files they contain. I realise this isn't a Windows 7 'problem' as such, but I know that this solution is possible in Windows 7, probably through a BAT file. Could someone please help? Thank you.
January 12th, 2010 4:19am

Hi,I believe it requires a lot of effort to write such bat file and we do not know if it will work. Here you have two options to slightly save some energy:1. Using search function to list all the *.PNG, copy the ones with same directory to its up one level folder.2. Add these files to Library and arrange them by type.
Free Windows Admin Tool Kit Click here and download it now
January 12th, 2010 1:11pm

Maybe a little late to help you, but for others looking to perform a similar task I found the easiest way as follows; 1. Use Winzip to create an archive with all of the folders containing the files you want to move. 2. Extract the files to the folder that you want them in by navigating to that folder and de-selecting the 'Use folder Names' option. Winzip will just extract the files to the specified folder without regard to the original folder name. You can then delete the old folders.
July 4th, 2010 2:52pm

I know this is a year old, but it never got answered... and I went looking for a way to do it. Here's the simple solution for /f %i in ('dir /A-D /B Level1\Level2\Level3\*.PNG') DO move Level1\Level2\Level3\%i Level1\Level2\%i dir /A-D /B tells it to show you all the non-directories in the directory. /B suppresses all the header and description information. The file name gets set into the variable %i and you use that to move it about. I searched Use %%i if you are doing it in a batch file. If you needed to do this recursively (ie you did not know what level1, level2, level3 were) you could use this same mechansim over and over again to identify the directories and move them each up a level. To remove the directories and the remaining trash just do rd /s/q Level1\Level2\Level3
Free Windows Admin Tool Kit Click here and download it now
December 21st, 2010 7:18pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics