The short answr is - don't use variablenames starting with a numeric. The reason is that %n
with n
numeric means "parameter n
to the procedure".
If you absolutely must use such names, then
for /f "tokens=1*delims==" %%v in ('set') do if /i "%%v"=="3name" set "newthing=%%w"