add or replace text in .txt file

March 6, 2009 at 01:04:56
Specs: Windows XP

I want to generate a text-file that lists all folder and subfolders as:
and I want to proceed eacht folder line with a string:
sting c:\foldername1\subfolder1\
sting c:\foldername2\subfolder2\
and save the file as

I already have this:
dir /s /on /b /a:d > c:\
that gives me a list with the directorys. And I can use the command on a folder by RMB --> files listing

Now I want to add the string in front of each line. But I can't figure out how to add the string, I thougth maybe by replacing the "c:\" with "string c:\"?

I'm a real noob in .bat files and really appreciate your help


See More: add or replace text in .txt file

Report •

March 6, 2009 at 01:49:00
for /f "tokens=*" %%a in ('dir /s /on /b /a:d') do echo String %%a >>c:\


Report •
Related Solutions

Ask Question