@echo off
set a[0] = 1
echo %a[0]%
When I try to run this, all I get is: "ECHO is off" and not a[0]. When I try to run it with echo on, all it returns is that echo is on. What do I need to change so that it only echoes the value of a[0]?
@echo off
set a[0] = 1
echo %a[0]%
When I try to run this, all I get is: "ECHO is off" and not a[0]. When I try to run it with echo on, all it returns is that echo is on. What do I need to change so that it only echoes the value of a[0]?
Remove the white spaces around the assignment.
Instead of ,
set a[0] = 1
Use
set a[0]=1
The script would look like .,
@echo off
set a[0]=1
echo %a[0]%