Code:
SETLOCAL
setdos /x-1256789A
if not isdir .\test\ md .\test\
setarray /f info[10,1]
set info[0,0]=CompanyName
set info[1,0]=FileDescription
set info[2,0]=FileVersion
set info[3,0]=InternalName
set info[4,0]=LegalCopyright
set info[5,0]=LegalTrademarks
set info[6,0]=OriginalFileName
set info[7,0]=ProductName
set info[8,0]=ProductVersion
set info[9,0]=Build
for %fn in (*.exe) gosub :doExe "%fn"
goto :end
:doEXE
set sNew=
rem build new EXE name
For /l %n in (0,1,9) echo if "%@trim[%@verinfo[%fn,@info[%n]]]" NE "" set %sNew=%sNew-`%@trim[%@verinfo[%fn,@info[%n]]]`
move /r /n "%fn" "test\%sNew"
:end
setdos /x+1256789A
ENDLOCAL
QUIT
Code:
This code snippet isn't producing the expected results for the "For /l %n in" line. What am i doing wrong please?