I`m verry new here and do not know much about batch files and so on, but I hope you can help me out here.
I have a problem, I want to create a txt file from a directory.. okay that works fine, now a little bit harder.
I want to create a txt file from Dir/SubDir/FileDataMap
I got a structure like this :
- Dir001
-+ SubDir001a
--+ FileData001a1
--+ FileData001a2
--+ FileData001a3
--+ FileData001a4
-+ SubDir001b
--+ FileData001b1
--+ FileData001b2
--+ FileData001b3
--+ FileData001b4
-+ SubDir001c
--+ FileData001c1
--+ FileData001c2
--+ FileData001c3
--+ FileData001c4
-+ SubDir001d
--+ FileData001d1
--+ FileData001d2
--+ FileData001d3
--+ FileData001d4
- Dir002
-+ SubDir002a
--+ FileData002a1
--+ FileData002a2
--+ FileData002a3
--+ FileData002a4
-+ SubDir002b
--+ FileData002b1
--+ FileData002b2
--+ FileData002b3
--+ FileData002b4
-+ SubDir002c
--+ FileData002c1
--+ FileData002c2
--+ FileData002c3
--+ FileData002c4
-+ SubDir002d
--+ FileData002d1
--+ FileData002d2
--+ FileData002d3
--+ FileData002d4
You get the picture

Well I got this script and it works till the last part, there it hangs.
What can i do to fix it?
Please help me.
Regards, Defcon5
Code: Select all
@echo off
cls
if exist Tree.txt goto end1
dir /on /b >>Tree.txt
echo creating txt file
:end1
echo Made Tree.txt...!
pause
cls
if exist SubTree.txt goto end2
if exist Tree.txt goto file_exists_a
echo Tree.txt not found!
goto end2
:file_exists_a
for /f "delims=" %%a IN (Tree.txt) do echo Listing directory: %%a...&&dir /on /b >>SubTree.txt "%%a"
:end2
echo Made SubTree.txt....!
pause
cls
if exist SubTree.txt goto file_exists_b
echo SubTree.txt not found!
goto end3
:file_exists_b
for /f "delims=" %%c IN (Tree.txt) do cd "%%c" && for /f "delims=" %%b IN (..\SubTree.txt) do echo Listing directory: %%c \ %%b ...&& dir /on /b >>..\Directories.txt "%%b"
:end3
echo Echt wel klaar....!?
pause
cls