Move file to folder based on part of file name
Posted: 08 Feb 2019 12:07
Hello, I'm trying to build a batch file that will automatically move files to 1 of 3 folders depending on which tag is in the file name.
Tags
-mC-
-mF-
-mP-
Example file names
253434276_weddingphotos-mC-_44.pdf <- Would go to folder 1
picturesToSend-mF-_08092018.pdef <- Would go to folder 2
354534_photos-mP-BestDogEver.pdf <- Would go to folder 3
3664Surfing_-mP-pictureFromToday.pdf <- Would go to folder 3
The file name will only have one of the above tags in the name and needs to be moved from the base folder to a sub directory based on the tag.
The script will most likely be used on a computer with Windows 10.
Any advice or pointers would be greatly appreciated!
-Thanks
Tags
-mC-
-mF-
-mP-
Example file names
253434276_weddingphotos-mC-_44.pdf <- Would go to folder 1
picturesToSend-mF-_08092018.pdef <- Would go to folder 2
354534_photos-mP-BestDogEver.pdf <- Would go to folder 3
3664Surfing_-mP-pictureFromToday.pdf <- Would go to folder 3
The file name will only have one of the above tags in the name and needs to be moved from the base folder to a sub directory based on the tag.
The script will most likely be used on a computer with Windows 10.
Any advice or pointers would be greatly appreciated!
-Thanks