Discussion Locked

Dos Command for MDB files on a drive

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I had a dos command with a bunch of switched that would output the path and file name of every access database on a certain drive. I cannot find it! Does anyone know how to get a list like that? It was actually an answer to a question someone else asked.

Unfortunalty I cannot find that question anywere. I remember the command had like 4 switches in it. I only want basic file information in the text file.

5 replies

by still_learning

Try the following (from the command prompt):

c:
dir *.mdb /s /p

the above changes drive to drive c:
then displays directory of any file with .mdb extension and pauses at the end of each screen. This can be redirected to a file as follows:dir *.mdb /s /p -> file.txt

where file.txt is the name of the output file. You can then view the contents of this file from any editor or word processor.

by budthegrey

The following switches are useful here:

/s -- search subdirectories
/p -- pause the output when the screen is full
/b -- give 'bare' file data

DIR C:\*.MDB /s will report the files in standard DIR format:

Directory of C:\WINNT\system32\ias

05/08/2001 08:00 409,600 dnary.mdb
05/08/2001 08:00 217,088 ias.mdb
2 File(s) 626,688 bytes

Add the '/b' switch for 'bare' format. This is useful if you are looking to make a text file ofjsut file names:

DIR C:\*.MDB /s/b
C:\WINNT\system32\ias\dnary.mdb
C:\WINNT\system32\ias\ias.mdb

In the above examples, of course, you would substitute the desired drive letter for "C:". Add redirection to create a file:

DIR C:\*.MDB /s/b >C:\FILELIST.TXT

Remeber to not use the '/p' switch if you are redirecting; the system will appear to hang when indeed it's simply waiting for you to hit a key.

HTH

This discussion is closed to new replies.