|Ah. I think I got it for part "A", to convert user input to strings which are subdirs to be searched for pdf files. The thing I don't know is how to pipe this collection to windows explorer. But here's as far as I got:|
@echo off & setlocal enabledelayedexpansion
SET 1=Model A
SET 2=Model B
SET 3=Model C
SET 100=Variant 100
SET 200=Variant 200
SET 300=Variant 300
SET 01=Version 01
SET 02=Version 02
SET 03=Version 03
SET /P Model=Please enter Model number i.e 1, 2, 3:
SET /P Variant=Please enter Variant i.e 100, 200, 300:
SET /P Version=Please enter Version i.e 01, 02, 03, etc:
echo looking for pdf's in "c:\!%model%!\!%variant%!\!%version%!"
dir /b /s "c:\!%model%!\!%variant%!\!%version%!\*.pdf"
::=== end snip
I believe this will get the list of files and their fullpaths. You're way ahead of me when it comes to presenting this list to explorer as in "explorer /select" - but maybe I'm overcomplicating things by assuming more than one file qualifies. If only one file is expected, and you want to open it, you only need to open it from the filename. I had no luck with "explorer /select". To open the file, one method using start::
for /f "tokens=*" %%a in ('dir /b /s "c:\!%model%!\!%variant%!\!%version%!\*.pdf"') do start %%a
which should open the file in it's default application (pdf usually adobe acro but that's locally determined).