FileMove all files from any folder titled "Data"? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
3ggg
Posts: 31
Joined: 11 Nov 2019, 19:52

FileMove all files from any folder titled "Data"?

07 Dec 2019, 14:38

I have dozens of subfolders titled "Data" and I want to relocate any files in those subfolders into one gigantic folder with everything in it.

Anyone have any idea how to do this?
User avatar
boiler
Posts: 4564
Joined: 21 Dec 2014, 02:44

Re: FileMove all files from any folder titled "Data"?  Topic is solved

07 Dec 2019, 15:05

Try this:

Code: Select all

Loop, Files, C:\TopDirPath\data, DR ; even if a folder named Data doesn't appear directly in C:\TopDirPath but they do at lower levels, it will find them via recursion
	FileMove, % A_LoopFileFullPath "\*.*", C:\PathToMyGiganticFolder ; A_LoopFileFullPath in this case will be the path to each of the Data directories
Of course, replace TopDirPath and PathToMyGiganticFolder with your actual paths to those directories.

One thing to note: When you move files from different folders into one folder, name collisions can occur. Decide how you want to handle conflicts (overwrite or not) and set the overwrite option of FileMove accordingly.
NatalyCat984
Posts: 3
Joined: 07 Dec 2019, 10:08

Re: FileMove all files from any folder titled "Data"?

07 Dec 2019, 16:27

Use Total Comander - Ctrl+ B Ctrl+X Ctrl+V :beer:

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, Bing [Bot], Google [Bot], HiSoKa, T3rryDactyl and 85 guests