1551
Coding Snacks / Re: [Request] Consolidate files in the parent folder
« Last post by Target on March 12, 2009, 07:57 PM »you could try this...
prompts for a folder, then moves all files from the subfolders to the root (files in subfolders are identified as having a different directory path than those in the root), then deletes all the subfolders
there are probably more elegant solutions, but this was quick - a brief tests indicates it works as advertised (though maybe best to test it for yourself...)
EDIT: simplified the code
fileselectfolder,MyFold,::{20d04fe0-3aea-1069-a2d8-08002b30309d}
loop, %myfold%\*.*,0,1
{
If a_loopfiledir <> %myfold%
filemove, %a_loopfilefullpath%,%myfold%
}
loop, %myfold%\*.*,2,1
fileremovedir, %a_loopfilefullpath%,1
exitapp
loop, %myfold%\*.*,0,1
{
If a_loopfiledir <> %myfold%
filemove, %a_loopfilefullpath%,%myfold%
}
loop, %myfold%\*.*,2,1
fileremovedir, %a_loopfilefullpath%,1
exitapp
prompts for a folder, then moves all files from the subfolders to the root (files in subfolders are identified as having a different directory path than those in the root), then deletes all the subfolders
there are probably more elegant solutions, but this was quick - a brief tests indicates it works as advertised (though maybe best to test it for yourself...)
EDIT: simplified the code

Recent Posts

