I need to get all the filenames in a directory and store them in some variable from a command line.
I came across this
`dir /s /b > print.txt`
As @Matt said, use a batch file.
setlocal enabledelayedexpansion set params= for /f "delims=" %%a in ('dir /s/b') do set params=!params! %%a