The following .cmd script has not been fully tested but seems to work.
It allows the user to pick a particular wim index from a large install.wim Windows installation file
You can set a default index on timeout if the user does not respond (it sets different default depending on Windows version number.
If there are more than nine indexes then CHOICE cannot be used, so we use set /P.
After the users choice, we get variables for Index number, full Version number, Windows version, Edition, and architecture as well as full name (description).
Should work on .wim and .esd.
OS must support DISM + needed DLLs.
Here is the script running with a timeout (no user entry):
C:\temp>testwim.cmd
INDEX 1 = x64 10.0.17134 Windows 10 Home
INDEX 2 = x64 10.0.17134 Windows 10 Home N
INDEX 3 = x64 10.0.17134 Windows 10 Home Single Language
INDEX 4 = x64 10.0.17134 Windows 10 Education
INDEX 5 = x64 10.0.17134 Windows 10 Education N
INDEX 6 = x64 10.0.17134 Windows 10 Pro
INDEX 7 = x64 10.0.17134 Windows 10 Pro N
DEFAULT = 6
Enter Index Number (1-7) : 6
INDEX 6 = "Windows 10 Pro" "x64" "10.0.17134"
VER="10.0.17134"
WVER="10"
EDITION="PRO"