1.

Solve : Dos directory changing help needed.?

Answer»

I am trying to make a batch file that will search children of a FOLDER(a few thousand) for a given file type to output in such a format in a txt file that all that is output is the filename and extension.
I am using DOS 6.22 to use MLS 110 420 (BAT ext file)
The things ive tried so far have been:

MLS.BAT[in root dir C:\BACKUPS>]

@ECHO OFF
IF "%1" = "" GOTO NOEXT
IF "%2" = "" GOTO NOFILE
DIR /S *.%1 > C:\BACKUPS\%2%1.txt
GOTO END
REM You know the rest ie. :NOEXT , etc
REM I have tried adding in the filenames only switch /B but it does not work here
REM This result is not what I'm looking for, I need the filenames/ext only

MLS.BAT[in each child, eg: C:\BACKUPS\011-20-8320\DBSDIO>]

@ECHO OFF
DIR /B *.%1 > %2%1.txt
REM You know the rest
REM This switch gives the desired output text file but there is a problem, there are
REM more than 3 thousand files in hundreds of childs and I cannot afford the time to
REM through every one and then I would have to find a way to compile all of the text
REM files into one.(which I havent discovered yet HELP ME IF YOU KNOW)

I have also used TREE /F but this will definitely not work(works fine for building my MP3 list for printing from all my band folders though).

When it comes down to it, I need to know if there is either one of two things:
1. Is it possible to move laterally through every child and grandchild one by one as if you are in it, and OPERATE a command, then move to the next one, where if you are at the last grandchild, you move up and to the next child and through its grandchilds, etc.
2. Is there a set of commands that can be used at > or in a bat that can do the search and produce the result I am looking for?

The reason is I have some ancient DOS based software that will look at this text file for other purposes but paths and other garbage will cause the software to crash.

Thanks.



Discussion

No Comment Found