Link to home
Start Free TrialLog in
Avatar of chris haag
chris haag

asked on

batch file to move folders and contents based on name

hello! Thanks in advance for anyone out there able to help.

I have several hard drives, and would like to segregate folders AND files alphabetically based on the folder name. the way I've set up the disks as follows:

disk0 - A-R = files need to be located in d:\files\folder-A-R
disk1 - S-Z = files need to be locate in z:\folderS-Z

I would like the batch file to determine based on the folder name which drive to move to, and move to the appropriate path.
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

ASKER CERTIFIED SOLUTION
Avatar of Lasse Bodilsen
Lasse Bodilsen
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nice batch example above.  I asked about PowerShell as you can use StartsWith there as you are looping through the folders, so meant to post this: https://technet.microsoft.com/en-us/library/ee692804.aspx
only solution using batch file