Computer Hope

Microsoft => Microsoft DOS => Topic started by: zahrex on June 22, 2021, 01:09:21 PM

Title: Batch commands to move folders to ones with similar names
Post by: zahrex on June 22, 2021, 01:09:21 PM
Sorry I couldn't come up with a better sounding subject.

I'm running Windows 10 and am not a programmer.

I have a utility where if I have a 100 folders in a subdirectory, it will create empty copies of the folders and number them. So if I have folders containing various files
/Apples
/Bananas
/Cherries

the utility will create the empty folders

/1Apples
/2Bananas
/3Cherries

in that same subdirectory

I want to move the original folders into the folders that have the number appended. (So /Apples would move inside /1Apples). Doing it manually is a pain when there are many folders. I'm looking for a batch program that would

For every folder in the subdirectory, take each folder whose name doesn't start with a number and move it into the corresponding folder that does begin with a number.