Solved Creating files at the specfied path

August 5, 2011 at 12:08:23
Specs: Windows XP
Hi,

I have a txt file which has a list of filenames wiith directory structure. Example below:

C:\createdocs\1.txt
C:\createdocs\2.txt
C:\createdocs\mydocs\3.txt
C:\createdocs\mysubdocs\4.txt
C:\createdocs\5.txt

I want to create a batch file which will read from this file one by one and will create the file with some dummy value ("this is a test file") at the path provided at each line. If the directory doesn't exist, create the directory as well. Is it possible using the batch scripts?


See More: Creating files at the specfied path

Report •


#1
August 6, 2011 at 07:22:21
✔ Best Answer
Untested:
for /f "delims=" %%a in (someFile.txt) do md "%%~DPa" & copy nul "%%a"

It'll probably throw errors, but that doesn't mean it didn't work.

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question