|you want to load them into an "array"? When you say "assign", that is the generally accepted meaning. Then variable with name: 1 contains value: user1?|
@echo off & setlocal enabledelayedexpansion
FOR /D %%G in (user*) DO (
echo %%G >> list.txt
:now, this will show them all AFTER they have been loaded
for /L %%a in (1,1,%c%) do echo !%%a!
set /a c+=1
also, i did NOT assume that names were in order, so if first one is user10, and second one is user3, then var 1=user10, var 2=user3.