I want to check for .raw files in my current running thumb drive and list it. And if there is more than one, then it will prompt the user to select which .raw files to use.
For example: In my current thumbdrive path (i.e. E:), I have a few .raw files.
Hello1.raw Hello2.raw Hello3.raw
So if there is only 1 .raw file, it will auto insert the .raw file path (i.e. E:\Hello.raw) to a command (vol231.exe -f E:\hello.raw imageinfo > hellllo.txt)
But if there is more than 1 .raw files, it will prompt the user to select the .raw file to insert into the command.
For example: "You have more than 1 .raw files. Please select 1." Then it will list the .raw files.
1. Hello1.raw
2. Hello2.raw
3. Hello3.raw
Then the user will select 1, 2 or 3. Then if the user select option 3. It will insert the command into vol231.exe -f E:\Hello3.raw imageinfo > end.txt.
Can anyone help me with it?
Edit:
I have this coding which somehow helps but I do not know how to fully utilize it into my needs.
FOR /F "tokens=* delims=|" %%i IN ('dir /b *.raw*') do echo %%i