Google Answers Logo
View Question
 
Q: List of files on a hard drive ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: List of files on a hard drive
Category: Computers > Operating Systems
Asked by: blue_bna-ga
List Price: $10.00
Posted: 07 Nov 2002 11:25 PST
Expires: 07 Dec 2002 11:25 PST
Question ID: 102043
I would like to create a text file that shows all non-hidden files on
my hard drive, with their sizes and dates last modified and sorted by
their directory.
e.g.:
C:\   
file1.txt  465k  10-20-2002
C:\temp
file2.txt   12k  02-01-2001
file1.zip  122k  01-22-2002

etc.

Ideally I could set a mask to look for partial file names or
extensions.  Sort of like using the Windows 'search' tool but saving
the results to a text file.
Answer  
Subject: Re: List of files on a hard drive
Answered By: skermit-ga on 07 Nov 2002 11:47 PST
Rated:5 out of 5 stars
 
What most people don't know, is that you already have the tools to
accomplish using a DOS window. If you're using Windows 95, 98, or ME,
go to Start --> Run... and type "command" (without quotes) in the run
box. If you're on XP or NT or 2000, type "cmd" (without quotes). Now
all you have to do is type:

dir

and you'll get a directory listing. By using certain flags or
switches, you can arrange the files by date, by name, by size, etc.

dir/s

will give you a recursive search going into sub-directories and
listing the files there.

dir/s *.txt

will find you every .txt file on your hard drive, and you can use the
asterisk to narrow down searches even more such as bank*.txt will give
you only text files starting with bank.

dir/?

will tell you which options you have to do different types of
searches.

As an example, I went into my quake directory and did a dir/s for you
so you can see the format:

-----
H:\games\Quake>dir/s
 Volume in drive H is h_drive
 Volume Serial Number is 8000-3E35

 Directory of H:\games\Quake

09/03/2002  08:51p      <DIR>          .
09/03/2002  08:51p      <DIR>          ..
09/26/1996  07:07a              25,920 CWSDPMI.EXE
09/30/1997  02:01p               1,238 DeIsL1.isu
09/03/2002  08:30p      <DIR>          DOCS
03/11/1997  09:41p               6,464 FXMEMMAP.VXD
09/26/1996  07:07a              17,408 GENVXD.DLL
08/26/1997  07:47a             423,936 GLQUAKE.EXE
09/03/2002  09:32p      <DIR>          ID1
09/17/1998  02:31p              14,554 LICENSE.TXT
09/26/1996  07:07a               9,883 MGENVXD.VXD
09/26/1996  07:07a              26,511 PDIPX.COM
03/21/1997  11:58a              18,892 PMPRO16.DLL
03/21/1997  11:58a              32,768 PMPRO32.DLL
09/26/1996  07:07a                  65 Q95.BAT
09/26/1996  07:07a             314,880 QLAUNCH.EXE
03/11/1997  01:29p             409,600 quake.exe
09/26/1996  07:07a              32,256 QUAKEUDP.DLL
09/21/1998  09:46a               9,729 readme.txt
02/18/1997  06:20a              80,804 spd3d.uc
02/27/1997  11:56a              79,620 spd3d.uc2
09/03/2002  09:27p      <DIR>          tenebrae
08/23/2002  01:23p             589,868 tenebrae.exe
08/23/2002  01:21p                 711 Tenebrae_Readme.txt
09/03/2002  08:32p              13,973 Uninst.isu
10/30/1997  06:06a             558,080 vquake.exe
03/21/1997  11:58a              27,542 WDIR16.DLL
03/21/1997  11:58a              40,960 WDIR32.DLL
03/21/1997  11:58a                   5 WDIRNOP.COM
03/21/1997  11:58a                 995 WDIRNOP.PIF
03/22/1997  09:20a             553,472 WINQUAKE.EXE
03/22/1997  03:52a               1,226 WQ.BAT
              27 File(s)      3,291,360 bytes

 Directory of H:\games\Quake\DOCS

09/03/2002  08:30p      <DIR>          .
09/03/2002  08:30p      <DIR>          ..
09/03/2002  08:30p      <DIR>          DOS
09/16/1998  11:51a               1,394 quake.cnt
09/18/1998  06:44a           2,142,857 Quake.hlp
09/21/1998  09:46a              36,864 readme.doc
               3 File(s)      2,181,115 bytes

 Directory of H:\games\Quake\DOCS\DOS

09/03/2002  08:30p      <DIR>          .
09/03/2002  08:30p      <DIR>          ..
03/11/1997  09:41p               9,237 3DFX.TXT
07/12/1996  12:31p              25,462 COMEXP.TXT
08/27/1997  06:10a               6,579 GLREADME.TXT
09/16/1998  08:04a               9,510 HELP.TXT
11/24/1997  01:52p               9,915 JOYSTICK.TXT
09/17/1998  02:31p              14,554 LICENSE.TXT
10/29/1996  11:33a               9,308 LICINFO.TXT
10/29/1996  02:24p              39,341 MANUAL.TXT
11/02/1996  12:09p               5,654 ORDER.TXT
09/21/1998  09:46a               9,729 README.TXT
10/31/1996  11:18a              72,454 TECHINFO.TXT
11/24/1997  01:29p              48,076 WQREADME.TXT
              12 File(s)        259,819 bytes

 Directory of H:\games\Quake\ID1

09/03/2002  09:32p      <DIR>          .
09/03/2002  09:32p      <DIR>          ..
09/03/2002  08:56p               2,126 config.cfg
09/03/2002  08:31p      <DIR>          glquake
10/01/1996  09:25a          18,689,235 PAK0.PAK
07/12/1996  12:31p          34,257,856 PAK1.PAK
09/03/2002  09:32p          43,209,328 pak2.pak
               4 File(s)     96,158,545 bytes

 Directory of H:\games\Quake\ID1\glquake

09/03/2002  08:31p      <DIR>          .
09/03/2002  08:31p      <DIR>          ..
10/09/1997  09:23a              32,768 15to8.pal
10/09/1997  09:23a               1,836 armor.ms2
10/09/1997  09:23a               2,032 backpack.ms2
10/09/1997  09:23a                 688 bolt.ms2
10/09/1997  09:23a                 520 bolt2.ms2
10/09/1997  09:23a                 520 bolt3.ms2
10/09/1997  09:23a               5,384 demon.ms2
10/09/1997  09:23a               8,848 dog.ms2
10/09/1997  09:23a                 316 eyes.ms2
10/09/1997  09:23a               2,540 flame.ms2
10/09/1997  09:23a               1,800 flame2.ms2
10/09/1997  09:23a                 600 gib1.ms2
10/09/1997  09:23a               1,780 gib2.ms2
10/09/1997  09:23a                 420 gib3.ms2
10/09/1997  09:23a                 320 grenade.ms2
10/09/1997  09:23a               4,748 g_nail.ms2
10/09/1997  09:23a               3,748 g_rock.ms2
10/09/1997  09:23a               1,748 g_shot.ms2
10/09/1997  09:23a               1,676 h_demon.ms2
10/09/1997  09:23a               1,824 h_dog.ms2
10/09/1997  09:23a                 800 h_guard.ms2
10/09/1997  09:23a                 732 h_ogre.ms2
10/09/1997  09:23a                 828 h_player.ms2
10/09/1997  09:23a                 544 h_wizard.ms2
10/09/1997  09:23a                 936 h_zombie.ms2
10/09/1997  09:23a                 916 invisibl.ms2
10/09/1997  09:23a                 420 lavaball.ms2
10/09/1997  09:23a               1,296 missile.ms2
10/09/1997  09:23a               6,192 ogre.ms2
10/09/1997  09:23a               7,988 player.ms2
10/09/1997  09:23a               2,068 quaddama.ms2
10/09/1997  09:23a               6,496 soldier.ms2
10/09/1997  09:23a                 116 spike.ms2
10/09/1997  09:23a               6,208 suit.ms2
10/09/1997  09:23a                 116 s_spike.ms2
10/09/1997  09:23a               3,676 v_axe.ms2
10/09/1997  09:23a               3,616 v_light.ms2
10/09/1997  09:23a               4,004 v_nail.ms2
10/09/1997  09:23a               3,860 v_nail2.ms2
10/09/1997  09:23a               1,108 v_rock.ms2
10/09/1997  09:23a               2,620 v_rock2.ms2
10/09/1997  09:23a               2,416 v_shot.ms2
10/09/1997  09:23a               3,208 v_shot2.ms2
10/09/1997  09:23a               3,100 wizard.ms2
10/09/1997  09:23a               2,496 w_g_key.ms2
10/09/1997  09:23a               1,936 w_spike.ms2
10/09/1997  09:23a               7,144 zombie.ms2
10/09/1997  09:23a                 420 zom_gib.ms2
              48 File(s)        149,376 bytes

 Directory of H:\games\Quake\tenebrae

09/03/2002  09:27p      <DIR>          .
09/03/2002  09:27p      <DIR>          ..
09/03/2002  09:37p               2,089 config.cfg
09/03/2002  09:26p      <DIR>          glquake
09/03/2002  08:45p      <DIR>          maps
08/22/2002  05:35p           9,669,159 PAK0.PAK
09/03/2002  09:37p             139,808 quick.sav
09/03/2002  09:00p             122,126 s0.sav
               4 File(s)      9,933,182 bytes

 Directory of H:\games\Quake\tenebrae\glquake

09/03/2002  09:26p      <DIR>          .
09/03/2002  09:26p      <DIR>          ..
09/03/2002  09:26p                 620 h_knight.ms2
09/03/2002  09:26p               4,164 knight.ms2
09/03/2002  08:55p               5,520 shambler.ms2
09/03/2002  09:26p               2,496 w_s_key.ms2
               4 File(s)         12,800 bytes

 Directory of H:\games\Quake\tenebrae\maps

09/03/2002  08:45p      <DIR>          .
09/03/2002  08:45p      <DIR>          ..
08/20/2002  01:20p             392,616 zoo.bsp
               1 File(s)        392,616 bytes

     Total Files Listed:
             103 File(s)    112,378,813 bytes
              23 Dir(s)   1,574,064,128 bytes free

H:\games\Quake>
-----

In order to save this to a file, just use the ">" operator and type a
filename, like search.txt.

dir/s > search.txt

will save the search in the text file search.txt. I've linked to a
couple guides on how to get around in dos, and please ask if you need
any further information. The tutorials also tell you how to switch to
different directories so you don't have to start at the root directory
(c:\) you can start at a sub-directory (like I did for my example, I
started in h:\games\quake\).


Search Strategy:

dir dos command tutorial


Additional Links:

Dos tutorial:
http://www.utc.edu/helpdesk/staff/train/dos_tutorial.htm

Another basic dos tutorial:
http://electron.cs.uwindsor.ca/60-104/dos.html


Thank you for the opportunity to answer your question, if you require
more information, please clarify the question, or if you find this
answer satisfactory, please feel free to rate it. Thank you!
   
skermit-ga
blue_bna-ga rated this answer:5 out of 5 stars
Sometimes the best answers are the most simple.  I knew all of the
pieces that skermit gave but hadn't thought about putting them
together.  Nicely done.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy