Solved how to get a prefix in a textfile via dos bat

November 2, 2011 at 03:40:40
Specs: windows 7
I have created a text file via dos in a dos batch, and want to get text in front of each line (original directory name.

for example:

input directory names (in the textfile)

I'd like to have the following result:
blabla do 111030
blabla do 111031
blabla do 111101
blabla do 111102

Can I create this prefix somehow in the text file using a dos batch or can I create this prefix already with creating the text file using some advanced command (I just used dir /b to create the list)

See More: how to get a prefix in a textfile via dos bat

Report •

November 2, 2011 at 04:35:39
✔ Best Answer
Stated there is no DOS in Windows 7 since it is a NT kernel system and what you believe to be the DOS prompt is NT system console, you can do the following

@echo off & setlocal
set prefix=blablabla
for /F "delims=" %%j in ('dir /b') do echo.%prefix% %%j>> list.txt

Report •

November 2, 2011 at 05:05:53
This solved my problem, thank you very much, ivo!

Report •

Related Solutions

Ask Question