I would like to be able to:
Below is what I have so far. It can choose one file only. I am not developer, this was copy/pasted/edited and cannot figure out how to enhance it to work with multiple files. The final goal is to have names of chosen files in .txt file, one name per new line
Many thanks in advance.
echo off
:START
cls
cls
setlocal enabledelayedexpansion
set count=0
:
:: Read in files
for %%x in (*.*) do (
set /a count=count+1
set choice[!count!]=%%x
)
:
echo.
echo Please choose file by number:
echo.
:
:: Print list of files
for /l %%x in (1,1,!count!) do (
echo %%x] !choice[%%x]!
)
echo.
:
:: Retrieve User input
set /p select=?:
echo.
echo !choice[%select%]! > my-choice.txt
echo TYPE ANY KEY TO GO BACK IN START MENU ...
pause >NUL
goto START
You almost have it :)
echo off
:START
cls
setlocal enabledelayedexpansion
set count=0
:: Read in files
for %%x in (*.*) do (
set /a count=count+1
set choice[!count!]=%%x
)
echo.
echo Please choose files by number:
echo.
:: Print list of files
for /l %%x in (1,1,!count!) do (
echo %%x] !choice[%%x]!
)
echo.
:: Retrieve User input
set /P selected="select file numbers: "
for %%i in (%selected%) do (
echo !choice[%%i]! >> my-choice.txt
)
echo.
echo TYPE ANY KEY TO GO BACK IN START MENU ...
pause >NUL
goto START
Please note that this does not check for valid numbers or anything else.