Im getting the list of disk on my computer :
REM lister les disques
:list_disk
ECHO Liste des disques
set n=0
for /f "skip=1 delims=" %%a in ('wmic logicaldisk get DeviceID^') do (
set nom[!n!]=%%a
set /A n+=1
)
set /A "N=%n%/2"
FOR /L %%i IN (0,1,%N%) DO (
echo !nom[%%i]!
echo/
)
EXIT /B 0
As you can see the discks ID are in an array.
Now I want to give the oportunity to the scipt user to chose or not a disk.
REM choix des disque
:choix nom
echo choix
set n=0
set /A "N=%n%/2"
SET c=n
FOR /L %%i IN (0,1,%N%) DO (
echo voulez vous relever le disque !nom[%%i]! (o/n) ?
SET /P c=
if c==o
rem call :HASH !nom[%%i]!
EXIT /B 0
Im trying to echo message !nom[%%i]!
but its doesn't work.
How would you do ?