Classic Computer Magazine Archive COMPUTE! ISSUE 86 / JULY 1987 / PAGE 107

Vanishing Directory

Paul W. Carlson

This handy utility for the IBM PC/PCjr and compatibles allows you to display all the files in your current directory without losing the information displayed on the screen. It works with both monochrome and color displays.

The DIR command is used perhaps more often than any other DOS command. Quite often, however, DIR causes valuable information to scroll off the screen. It can help somewhat to use the /W switch with DIR, since that option lists files in wide screen format, without indicating the number of bytes or date of a file. However, this format usually overwrites some information, too, and it can be harder to read than the normal DIR display.

"Vanishing Directory" can display all the normal files (not hidden or system files) on a floppy disk or in the current directory of a hard disk. What makes this program so useful is that it literally vanishes when it's no longer needed, leaving the screen as it appeared before you summoned the program. (You may lose the top line of the screen if you invoke the program when the cursor is on the very bottom screen line.)

The program listed in this article is a BASIC filemaker. Type in the program and save a copy, then run it. The program uses an internal checksum to check for typing errors. If no errors are found, it creates an executable machine language file named VDIR.COM. (Because the BASIC program creates a file named VDIR.COM, you must not use that name for the BASIC program itself.)

VDIR.COM is very easy to use. At the DOS prompt, simply type VDIR and press Enter. The program clears the screen and displays a directory similar to that shown by DIR/W. Filenames are separated with double vertical bars for easier reading. If there are more than 100 files on the disk, the display pauses after the first 100 files are listed, waiting until you press a key. After all the files are listed, you can press any key to restore the previous screen instantly.

The program always displays the contents of the current disk and does not allow an opportunity for swapping disks. If you have two floppy disk drives, put VDIR.COM on your working copy of the system disk. To display the contents of another disk, place the disk containing VDIR.COM in the inactive drive and place the disk you want to examine in the active drive. Then invoke VDIR.COM, preceding the command with the inactive drive's designation. For instance, if the drive A: is the active drive, place the disk containing VDIR.COM in drive B: and enter the command B:VDIR.COM.

If you have a single drive, put VDIR.COM on any disk where you might want to use it. Fortunately, VDIR.COM is a small program and does not take up much disk space.

Hard disk users should put a copy of VDIR.COM in the same directory that contains other DOS commands that load from disk (such as FORMAT) or in any directory included in the DOS search path. If you want a display of the files in some other directory, use a CHDIR or CD command to change directories before invoking VDIR.COM.

VDIR.COM Filemaker

For instructions on entering this program, please refer to "COMPUTE!'s Guide to Typing In Programs" elsewhere in this issue.

II 100 ' VDIR.COM filemaker
BB 110 '
FE 120 ' Copyright 1987 COMPUTE! Publications, Inc.
FM 130 ' All rights reserved.
IN 140 CLS : PRINT"COPYRIGHT 1987" : PRINT"COMPUTE! PUBLICATIONS, INC." : PRINT"ALL RIGHTS RESERVED." : FOR X = l TO 1500 : NEXT X
IL 145 '
MC 150 CLOSE : OPEN "VDIR.COM" FOR OUTPUT AS 1
KM 160 PRINT#l, CHR$(&HE9);CHR$(&H6E);CHR$(&,H11);
OD 170 FOR N = 1 TO 4327 : PRINT#1,CHR$(0); : NEXT
FJ 180 T = 0 : FOR J = 1 TO 579 : READ A$ : N = VAL("H" + A$)
BK 190 T = T + N : PRINT#1, CHR$(N); : NEXT : CLOSE 1
FI 200 IF T = 55374! THEN PRINT"VDIR.COM successfully created" : END
GP 210 KILL "VDIR.COM"PRINT CHR$(7);"Typing error. Check DATA statements"
PC 220 DATA 00, 00, 00, 00, 2A, 2E, 2A, 00, 43, 75
KC 230 DATA 72, 72, 65, 6E, 74, 20, 64, 69, 72, 65
KK 240 DATA 63, 74, 6F, 72, 79, 20, 69, 73, 20, 20
OJ 250 DATA 3F, 3A, 5C, 24, 44, 69, 73, 6B, 20, 61
CA 260 DATA 63, 63, 65, 73, 73, 20, 65, 72, 72, 6F
FG 270 DATA 72, 0A, 0D, 24, 0A, 0D, 50, 72, 65, 73
EC 280 DATA 73, 20, 61, 6E, 79, 20, 6B, 65, 79, 20
KI 290 DATA 74, 6F, 20, 63, 6F, 6E, 74, 69, 6E, 75
JN 300 DATA 65, 20, 6C, 69, 73, 74, 69, 6E, 67, 2E
DK 310 DATA 2E, 2E, 24, 0A, 0A, 0D, 50, 72, 65, 73
DH 320 DATA 73, 20, 61, 6E, 79, 20, 6B, 65, 79, 20
FO 330 DATA 74, 6F, 20, 72, 65, 73, 74, 6F, 72, 65
NG 340 DATA 20, 74, 68, 65, 20, 73, 63, 72, 65, 65
LN 350 DATA 6E, 2E, 2E, 2E, 24, B4, 0F, CD, 10, A2
PO 360 DATA A3, 10, 88, 3E, A6, 10, C7, 06, A7, 10
OC 370 DATA BA, 03, C7, 06, A4, 10, 00, B0, A8, 04
EP 380 DATA 75, 00, 07, 06, 64, 10, 00, B8, C7, 06
QN 390 DATA A7, 10, DA, 03, B4, 03, 8A, 3E, A6, 10
OS 400 DATA CD, 10, 68, 2E, AA, 10, 88, 0E, AB, 10
CN 410 DATA 88, 36, A9, 10, B9, A0, 0F, 1E, 0E, 07
QJ 420 DATA 8B, 16, A7, 10, 8D, 3E, 03, 01, A1, A4
OI 430 DATA 10, 8E, D8, BE, 00, 00, EC, A8, 01, 75
HM 440 DATA FB, EC, AB, 01, 74, FB, 8A, 24, 26, 88
NO 450 DATA 25, 46, 47, E2, ED, 1F, C6, 06, AC, 10
IK 460 DATA 00, B8, 00, 06, B7, 07, 33, C9, BA, 4F
CB 470 DATA 18, CD, 10, BB, 00, 02, 33, DB, 33, D2
HF 480 DATA CD, 10, B8, 00, 00, A0, A3, 10, 3C, 07
CG 490 DATA 74, 02, B0, 02, CD, 10, C6, 06, AD, 10
LH 500 DATA 00, F6, 06, AC, 10, 01, 75, 36, B4, 19
OL 510 DATA CD, 21, 04, 41, 8D, 36, F2, 11, 83, C6
NK 520 DATA 16, 88, 04, B4, 47, 8D, 36, AE, 11, B2
HN 530 DATA 00, CD, 21, BD, 36, AE, 11, 8A, 04, 46
BL 540 DATA 3C, 00, 75, F9, 4E, B0, 0A, 88, 04, 46
CN 550 DATA 88, 04, B0, 0D, 46, 88, 04, 46, B0, 24
OL 560 DATA 88, 04, B4, 09, 8D, 16, F2, 11, CD, 21
OK 570 DATA 8D, 16, AE, 11, CD, 21, F6, 06, AC, 10
CA 580 DATA 01, 75, 48, BD, 16, AE, 10, B4, 1A, CD
EB 590 DATA 21, C6, 06, AC, 10, 01, B4, 4E, 8D, 16
PI 600 DATA EE, 11, B9, 00, 00, CD, 21, 72, 50, FE
MN 610 DATA 06, AD, 10, B9, 11, 00, 8D, 1E, AE, 10
HK 620 DATA 83, C3, IE, 49, 8A, 17, 80, FA, 00, 74
PF 630 DATA 07, B4, 02, CD, 21, 43, EB, F1, B4, 02
GC 640 DATA 83, F9, 02, 75, 04, B2, BA, EB, 02, B2
NI 650 DATA 20, CD, 21, E2, Fl, 80, 3E, AD, 10, 64
OH 660 DATA 75, 0F, 8D, 16, 20, 12, B4, 09, CD, 21
EK 670 DATA B4, 07, CD, 21, E9, 28, FF, 8D, 16, EE
HM 680 DATA 11, B4, 4F, CD, 21, 72, 0A, EB, B0, 8D
GF 690 DATA 16, 0C, 12, B4, 09, CD, 21, 8D, 16, 47
IH 700 DATA 12, B4, 09, CD, 21, B4, 07, CD, 21, B4
II 710 DATA 00, A0, A3, 10, CD, 10, B4, 05, A0, A6
NO 720 DATA 10, CD, 10, B9, A0, 0F, BD, 36, 03, 01
BH 730 DATA A1, A4, 10, 8B, 16, A7, 10, 1E, 0E, 1F
DH 740 DATA 8E, C0, BF, 00, 00, EC, A8, 01, 75, FB
ND 750 DATA EC, A8, 01, 74, FB, BA, 24, 26, 88, 25
EP 760 DATA 46, 47, E2, ED, IF, B4, 01, BA, 2E, AA
FK 770 DATA 10, BA, 0E, AB, 10, CD, 10, B4, 02, 8A
JF 780 DATA 3E, A6, 10, 8A, 36, A9, 10, 80, FE, 00
GH 790 DATA 74, 02, FE, CE, B2, 00, CD, 10, C3