It seems like you simply forgot to use the exclamation mark ("
!") with the variable you set within the loop, and to resolve to simply use
!_filelist! rather than
The below script will set the initial
set _filelist=, variable with a single comma value so the first iteration will be
,, and then the first iterated value rather than the null plus one comma you get two back to back commas giving a unique pattern to work with for parsing.
You can use Variable Replace functionality to parse out the double commas (
,,), and replace those with a blank value. The final iterated and set variable value will then be parsed from outside the loop with
set _filelist=%_filelist:,,=% removing the double comma prefixed value.
cd /D %~dp0
for /f "delims=|" %%f in ('dir /b %CD%') do (
Delayed Expansion will cause variables within a batch file to be
expanded at execution time rather than at parse time, this option is
turned on with the SETLOCAL EnableDelayedExpansion command. 
When delayed expansion is in effect, variables can be immediately read
using !variable_name! you can also still read and use %variable_name%
that will show the initial value (expanded at the beginning of the