Code: Select all
Let>FILE_ROOT_PATH=X:\your\path
RunProgram>cmd /c chcp 65001 > nul & cmd /c dir "%FILE_ROOT_PATH%\*.*" /s /b /o:gn /A-D > "%FILE_ROOT_PATH%\results.txt"
cmd /c chcp 65001 > nul
&
cmd /c dir "%FILE_ROOT_PATH%\*.*" /s /b /o:gn /A-D > "%FILE_ROOT_PATH%\results.txt"
The first part is to set the output format to UTF-8 (chcp 65001)
The & tells the command prompt to execute the next part in the same run as the first
The third part is the standard file dir command with the following switches:
/s = list files in subfolders as well
/b = remove the header and footer part of the output
/o:gn = sort the list alphabetically
/A-D = only list files