[quote="JohnZeman"]I wouldn't make a button for this, I'd simply put the lister in flat view then drag and drop the files up to whichever parent folder you wanted.[/quote] Thanks for the suggestion John. I have been doing this procedure up till now already and it works fine for one small tree at a time. The problem is that there are hundreds of folders containing subfolders! I have to select each set of files in each subfolder manually, and move the subfiles up a folder level manually for each one. It works, but man its hard on my wrist and fingers after a few minutes of repetitive mousing. This is precisely the procedure I am try to automate.
[quote="abr"]The code you´re looking for might be this one:
@dirsonly
@nofilenamequoting
Copy MOVE FILE "{filepath$}\*" HERE
Delete QUIET NORECYCLE
I´d strongly advise you to check it in some test folders first, because they contain a "dangerous"
Delete QUIET NORECYCLE, so your empty folders will be erased.[/quote] Thanks abr. I tried your command, and it partly works on a SINGLE folder (with subfolders) at a time, but only under certain conditions/circumstances, and does not work on multiple folders at once. its quite a mess in terms of what I would like to achieve.
I may not have been clear enough on what I need to achieve. I need to select a primary folder that contains in it (say) 10 folders each named after (say) one author (lets call these 10 the parent folders I want to keep). Each of the 10 parent folders I have selected has: a) a file or more in them and b) a subfolder with a file or more in that. When I select the first 10 parent folders (of authors) I would like the command button to: a) LEAVE the existing files in the parent folders alone and also leave those parent author folders alone, but b) take each subfolder, and move the files in them up one level and then delete that empty subfolder. The result is that the parent folder is retained, all subfolders are gone, and their former contents are in the parent folder now.
Start:
folder1: file1
.....subfolderA: file 2, file3
folder2: (there are no files here)
.....subfolderB: file 4, file5
etc
Result:
folder1: file1, file 2, file3
folder2: file 4, file5
etc
What I get with your command is all the subfolders moved up a level, but they are still the same subfolder names. So, if i had 10 folders with 1 subfolder in each, the result of this button is now up to 20 folders. ie the contents of the subfolders are not moved one level up, but the entire subfolder is moved. Secondly, all the files in the list of folders are moved up one level into a single folder. If the parent folder is empty at the start (no files, but has a subfolder with files), then this command makes the subfolder the parent and deletes the original parent (so thanks for the danger warning).
So its not working the way I need (yet!). I also need to select dozens of primary folders to run it on, or else i have to run it one folder at a time (too slow). I will check out the other thread, but some of them seem like batch files not button.