Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
So far I have a batch file that creates a set of nested folders within a specified folder. So far so good. Then I want to create a file by using information in a text file, amending it and writing a new .txt file into one of the just created folders.
this is how I got the folders created:@echo off
set /p Project="name"
md %1\%Project%
md %1\%Project%\folder_1 %1\%Project%\Folder_2 %1\%Project%\Folder_3now for the part I can't quite get:
the information in the text file I wish to use and amend to write the text file appears as follows:
(the number of names within the [] will always stay the same but the number of entries under each will change but it will always start Dir1=, Dir2=, Dir3=, Dir4= on and on until the last entry is reached and it starts again for the new [] heading.
[Directories]
blah="path"
blah="path"
blah="path"
[Objects]
Dir1="path"
Dir2="path"
Dir3="path"
[Maps]
Dir1="path"
Dir2="path"
Dir3="path"
Dir4="path"
Dir5="path"
Dir6="path"the file I want to create should have all of the above as it is in the first text file but then add two lines.
the first should always be under the last Dir entry under [Objects] and should start Dir#="path"
where # is the number after the one from the line above it (i.e if the line above starts Dir26=... then this line should start Dir27= and then the path to Folder_1 created earlier.the second is the same as above but should be entered below the last entry in the [Maps] portion of the text.
I hope this is clear let me know if not.
thanks
Sany

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |