Batch script to find a file and run it, if multiple matches are found list them to choose from...
Posted on 2013-05-22
I have a batch file that I now need to add the ability to search for a file based on a 3 character code the user will be prompted to enter, once that file is found, open it. Simple right?! However there will be many files with that same 3 character code in the name, so if multiple matches for that code are found, is there a way to dynamically create a list for the user to choose which one of those is the appropriate file to open?
The file names look like: "City-Department-001.reg"
There are spaces in many of the files names, and all the 3 character codes are alphanumeric with a preceding hyphen, and all files are a .reg extension. And the files will be in a sub folder of the folder that contains the batch file.
It's still early, so if I haven't explained myself well, please feel free to ask for better information.
Thanks very much,