Is there any size limit for a batch variable

January 7, 2010 at 04:56:36
Specs: Windows XP
in my batch code i use a batch variable that stores the names(including the path) of files in a folder by appending the names to the variable through looping..
but finally when i write the variable to a file, it is not writing around last 40 % of file names(totally around 240 file names r there)..
is it because of any size limitation
plz help

See More: Is there any size limit for a batch variable

Report •

#1
January 7, 2010 at 06:58:42
A little admittedly unscientific testing seems to indicate the limit is about 2047.

You can play with this bat.

============================
@echo off > lines & setLocal EnableDELAYedeXpansion

for /L %%a in (1 1 2047) do (
>> lines echo %%a
set V=!V!x
)
> lenght echo !V!


=====================================
Helping others achieve escape felicity

M2


Report •

#2
January 7, 2010 at 19:05:17
ooh k...thanks a lot

Report •

#3
January 7, 2010 at 19:12:25
Thats a lot of x's

Report •

Related Solutions

#4
January 7, 2010 at 19:20:55
yep... about 2047


=====================================
Helping others achieve escape felicity

M2


Report •

Ask Question