@echo off setlocal enabledelayedexpansion enableextensions set LIST= for %%x in (*) do set LIST=!LIST!;%%x echo %LIST:~1%
This will not indicate the names of the files that contain ; . However, the following:
@echo off setlocal enabledelayedexpansion enableextensions set LIST= for %%x in (*) do ( echo %%x|findstr ";">nul 2>&1 if errorlevel 1 (set LIST=!LIST!;%%x) else (set LIST=!LIST!;"%%x") ) echo %LIST:~1%
source share