Each file prefix is also the name of the folder? What is the variant calling command you are using? You could place them all into one folder, and run something like this:
for file in *.bam; do variant_calling_cmd $file; done
Or, change your file summing up the prefixes (
input_vars.txt), and create a bash script that enters the directory, and runs the command.
and save as
variant_call_all.sh, and pass the prefix to the script using xargs:
cat input_vars.txt | xargs -n 1 bash variant_call_all.sh
If there are flags or parameters to the variant calling program you're using, you will need to add them.