Search found 14 matches

by Defcon5
14 Jan 2013 11:00
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

The >> appends to the file. If it duplicated the lines then it is because you ran it more than once. Delete the file and run it again. The order of /o:n /b /s /a:d make no difference. i did run it once not twice, where the .... do you think i run it twice???? When you say "double lines" m...
by Defcon5
14 Jan 2013 03:44
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

foxidrive wrote:The >> appends to the file.

If it duplicated the lines then it is because you ran it more than once. Delete the file and run it again.

The order of /o:n /b /s /a:d make no difference.


i did run it once not twice, where the .... do you think i run it twice???? :?
by Defcon5
14 Jan 2013 02:33
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

Try this: Edited: @echo off for /f "tokens=5 delims=\" %%a in (' dir /b /s /a:d /o:n ') do >>directories.txt echo %%a tried this for /f "tokens=5 delims=\" %%a in (' dir /on /b /s /a:d ') do >>directories.txt echo %%a and tried this for /f "tokens=5 delims=\" %%a in ('...
by Defcon5
14 Jan 2013 02:07
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

I explained myself verry clearly. the dir structure is 3 deep and i need only the fourth dirnames of that in the output.txt But clearly some doesn`t seem to see it. I`m a dutch person, but I did explained it verry clearly here. Read all of my post, than maybe you see what i ment. I wouldn't have as...
by Defcon5
13 Jan 2013 18:33
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

Do you want that last folder, and not the filenames? That's what this does which I gave you earlier: @echo off for /f "delims=" %%a in (' dir /b /s /a:d /o:n ') do >>directories.txt echo %%~nxa This is not correct, i need not the AUDIO_TS and VIDEO_TS in the output file. The line you gave...
by Defcon5
13 Jan 2013 18:28
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

than i got also the AUDIO_TS and VIDEO_TS in the output file and that`s is not what i want.
by Defcon5
13 Jan 2013 18:09
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

@Defcon5 , if you just need to get the final folder names in all these main DIRs and the tree and subtree files is not going to be used in any other thing "usless" then just use this code, @Echo Off For /F "delims=" %%A in ('DIR /B /S /A:D "*.*"') Do Echo %%~nA pause a...
by Defcon5
13 Jan 2013 17:18
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

I explained myself verry clearly. the dir structure is 3 deep and i need only the fourth dirnames of that in the output.txt Where did you say that? Is this what you want? FileData001a4 FileData001b4 FileData001c4 FileData001d4 FileData002a4 FileData002b4 FileData002c4 FileData002d4 did that already...
by Defcon5
13 Jan 2013 16:51
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

I explained myself verry clearly.

the dir structure is 3 deep and i need only the fourth dirnames of that in the output.txt
But clearly some doesn`t seem to see it.
I`m a dutch person, but I did explained it verry clearly here.

Read all of my post, than maybe you see what i ment.
by Defcon5
13 Jan 2013 11:46
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

Nope, not what i needed, but we solved it with a php file. here for the people who needs it too. <?php $data = array(); if ($root = opendir('.')) { while ($file = readdir($root)) { if ($file == '.' || $file == '..') continue; if (is_dir($file)) { if ($sub = opendir($file)) { while ($subfile = readdi...
by Defcon5
13 Jan 2013 08:08
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

did that already, but I don`t want to see the whole structure where everything is. I don`t want to see this out put : Dir001\SubDir001a\FileData001a1\dirname001 Dir001\SubDir001a\FileData001a1\dirname002 Dir001\SubDir001a\FileData001a1\dirname003 Dir001\SubDir001a\FileData001a1\dirname004 But dirnam...
by Defcon5
13 Jan 2013 03:14
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Re: Multiple Directories and Sub Directories to txt file

The script does work, but after when it gets to this point : 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 d...
by Defcon5
12 Jan 2013 20:30
Forum: DOS Batch Forum
Topic: Multiple Directories and Sub Directories to txt file
Replies: 35
Views: 18040

Multiple Directories and Sub Directories to txt file

Hello, 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 l...