dir and output binding info

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Exley
Posts: 1
Joined: 08 Dec 2015 14:34

dir and output binding info

#1 Post by Exley » 08 Dec 2015 14:41

hi :mrgreen:

i have small problem
i have a folder filled with folders and just folders

so doing DIR /B > list.txt is no biggie
but since it lists folders, how can I add custom info/text
for each folder name

for example if output is:

folder1
folder2
folder3
--------

and I want to add .png IN OUTPUT file (.txt), so it would be listed as
folder1.png
folder2.png

i followed few loop examples from google
even tried with adding custom variable and then echo dir to .txt with variable
but nothing happens

any help ?

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: dir and output binding info

#2 Post by Squashman » 09 Dec 2015 09:26

Code: Select all

FOR /D %%G IN (*) DO echo %%G.png

Post Reply