Obtaining a list of files from a specific directory

Posted by Steve Robathan on Super User See other posts from Super User or by Steve Robathan
Published on 2014-05-27T14:27:06Z Indexed on 2014/05/27 15:31 UTC
Read the original article Hit count: 339

Filed under:
|

I can get a list of files from a text file from a specific directory, but they are naturally in singles. I need to create a text file that will give the contents, but all in 1 line separated by a space. My batch is here:

dir /a /b /-p /o:gen >%USERPROFILE%\Desktop\file_list_full.txt

As an example, this will give:

Hello.exe

Help.txt

Big.png

sound.ogg

I need it to be:

Hello.exe Help.txt Big.png sound.ogg

How can I do this?

© Super User or respective owner

Related posts about command-line

Related posts about dir