troubleshooting Question

Batch : Loop thru text file (with wild card) and move any matching files to parent folder.

Avatar of Patrick O'Dea
Patrick O'DeaFlag for Ireland asked on
Windows Batch* Bat
2 Comments1 Solution67 ViewsLast Modified:
Loop thru text file (with wild card) and move any matching files to parent folder.

1. I have one file called find.txt with data similar to the follow format.

ABC123
DEF123
HIJ123
KPI123
123456

2. I want a batch script to loop thru this text file and ALSO loop thru every file in current folder.

3. If match found (using wildcards - asterisk ) then move file to parent folder.

4. Example:
File ABC123xxxxx.pdf is a match to the first line of my find.txt file "*ABC123*  -  and should be moved to parent folder.

Similarly, file XXX_DEF123_XXX.pdf would also be a match to "DEF123" in find.txt.


WHat is the batch script ??

THanks all!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros