Old-style DIR command

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I seem to remember from my old XT days that I could type DIR with some added
command (slash followed by a letter) that would allow me to print the DIR
listing to my printer, or print it to a text file.

When I now type DIR /? for help on the command, I don't see these options.
Am I imagining this old command option, or was it really there in the past
and it's gone.

If it is gone, anyone have suggestions on how to do what I want?

Thanks,

Michael
 
I seem to remember from my old XT days that I could type DIR with some added
command (slash followed by a letter) that would allow me to print the DIR
listing to my printer, or print it to a text file.

When I now type DIR /? for help on the command, I don't see these options.
Am I imagining this old command option, or was it really there in the past
and it's gone.

If it is gone, anyone have suggestions on how to do what I want?

Thanks,

Michael

The command line method is
dir path\filename.ext
(Help and Support> search for command-line and click on "command line
reference A-Z" for a list of available commands

A useful and lightweight GUI tool for this task:
"Karen's Directory Printer" (freeware)
http://www.karenware.com/powertools/powertools.asp
 
I seem to remember from my old XT days that I could type DIR with some
added
command (slash followed by a letter) that would allow me to print the DIR
listing to my printer, or print it to a text file.

When I now type DIR /? for help on the command, I don't see these options.
Am I imagining this old command option, or was it really there in the past
and it's gone.

If it is gone, anyone have suggestions on how to do what I want?

Thanks,

Michael

To print a directory to text file from within a dosbox:
DIR {pathfilename} > c:\DirList.txt

Example:
SET
DIR %WINDIR%\*.DLL > C:\MyDir.txt
EDIT C:\MyDir.txt

There is a pipe to the printer port in old MSDOS, but I don't recommend it
from NT, 2K, or XP in particular. Better to print a resultant document from
Windows than from DOS, thus I just gave the file creation method example.

Best wishes, and Happy Holidays!

Winguy
 
I seem to remember from my old XT days that I could type DIR with some added
command (slash followed by a letter) that would allow me to print the DIR
listing to my printer, or print it to a text file.

When I now type DIR /? for help on the command, I don't see these options.
Am I imagining this old command option, or was it really there in the past
and it's gone.

If it is gone, anyone have suggestions on how to do what I want?

Thanks,

Michael


From the command prompt (Start > Run > Cmd.exe), simply change to
the desired directory and type "dir > filelist.txt" or "dir > lpt1,"
just as you used to do in DOS. Any of the switches for the DIR
command (type "dir /?") will work with this command, if you wish to
modify the output. You can then subsequently edit the resulting text
file using NotePad, WordPad, Word, etc.

Alternatively:

HOW TO Add a Print Directory Feature for Folders in Windows XP
http://support.microsoft.com/?kbid=321379

The "Dir /?" command works here, by the way:

C:\>dir /?
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

[drive:][path][filename]
Specifies drive, directory, and/or files to list.

/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files - Prefix meaning not
/B Uses bare format (no heading information or summary).
/C Display the thousand separator in file sizes. This is the
default. Use /-C to disable display of separator.
/D Same as wide but files are list sorted by column.
/L Uses lowercase.
/N New long list format where filenames are on the far right.
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date/time (oldest first)
G Group directories first - Prefix to reverse order
/P Pauses after each screenful of information.
/Q Display the owner of the file.
/S Displays files in specified directory and all subdirectories.
/T Controls which time field displayed or used for sorting
timefield C Creation
A Last Access
W Last Written
/W Uses wide list format.
/X This displays the short names generated for non-8dot3 file
names. The format is that of /N with the short name inserted
before the long name. If no short name is present, blanks are
displayed in its place.
/4 Displays four-digit years

Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.


--

Bruce Chambers

Help us help you:



You can have peace. Or you can have freedom. Don't ever count on having
both at once. - RAH
 
There is a pipe to the printer port in old MSDOS, but I don't recommend it
from NT, 2K, or XP in particular. Better to print a resultant document from
Windows than from DOS, thus I just gave the file creation method example.
Why not? It works fine.

Cheers,

Cliff
 
Perfect!

Michael


WinGuy said:
To print a directory to text file from within a dosbox:
DIR {pathfilename} > c:\DirList.txt

Example:
SET
DIR %WINDIR%\*.DLL > C:\MyDir.txt
EDIT C:\MyDir.txt

There is a pipe to the printer port in old MSDOS, but I don't recommend it
from NT, 2K, or XP in particular. Better to print a resultant document from
Windows than from DOS, thus I just gave the file creation method example.

Best wishes, and Happy Holidays!

Winguy
 
Thanks! The freeware you mentioned works good, as does the DOS line command
you supplied.

Michael
 
Perfect! I knew I wasn't dreaming :-)

Michael


Bruce Chambers said:
I seem to remember from my old XT days that I could type DIR with some added
command (slash followed by a letter) that would allow me to print the DIR
listing to my printer, or print it to a text file.

When I now type DIR /? for help on the command, I don't see these options.
Am I imagining this old command option, or was it really there in the past
and it's gone.

If it is gone, anyone have suggestions on how to do what I want?

Thanks,

Michael


From the command prompt (Start > Run > Cmd.exe), simply change to
the desired directory and type "dir > filelist.txt" or "dir > lpt1,"
just as you used to do in DOS. Any of the switches for the DIR
command (type "dir /?") will work with this command, if you wish to
modify the output. You can then subsequently edit the resulting text
file using NotePad, WordPad, Word, etc.

Alternatively:

HOW TO Add a Print Directory Feature for Folders in Windows XP
http://support.microsoft.com/?kbid=321379

The "Dir /?" command works here, by the way:

C:\>dir /?
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

[drive:][path][filename]
Specifies drive, directory, and/or files to list.

/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files - Prefix meaning not
/B Uses bare format (no heading information or summary).
/C Display the thousand separator in file sizes. This is the
default. Use /-C to disable display of separator.
/D Same as wide but files are list sorted by column.
/L Uses lowercase.
/N New long list format where filenames are on the far right.
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date/time (oldest first)
G Group directories first - Prefix to reverse order
/P Pauses after each screenful of information.
/Q Display the owner of the file.
/S Displays files in specified directory and all subdirectories.
/T Controls which time field displayed or used for sorting
timefield C Creation
A Last Access
W Last Written
/W Uses wide list format.
/X This displays the short names generated for non-8dot3 file
names. The format is that of /N with the short name inserted
before the long name. If no short name is present, blanks are
displayed in its place.
/4 Displays four-digit years

Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.


--

Bruce Chambers

Help us help you:



You can have peace. Or you can have freedom. Don't ever count on having
both at once. - RAH
 
Enkidu said:
Why not? It works fine.

Cheers,

Cliff

Unlike 95, 98, and ME and maybe NT, the XP (and I think the NT) operating
systems will always intercept attempts by dos programs to directly access a
port (including printer ports). It might work, and it might not work quite
as expected because of that. The compatibility is pretty good, though, but
direct port control is not possible under XP. Remember, there is no DOS in
XP anymore --- dos is simulated by XP, and sometimes that causes
compatibility problems with dos based activities. So, best to avoid it when
other alternatives exist.
 
Perfect!

Michael


"WinGuy" wrote:

As others have pointed out, the other pipe is to LPT1 instead of to a file.
But I still don't recommend using it in XP.

Do you miss the old DOS Help file? Heh, I still refer to it now and then.
Find a 98 CD, and create a folder in XP. For example, I'll call that folder:
"C:\!MyBackUps\OldMSDOS"

On the 98 CD, look in the "WIN98 | tools | oldmsdos" folder and copy the
files HELP.COM, HELP.HLP, and QBASIC.EXE to your new OldMSDOS folder. Then
create the following batch file named "DOSHELP.BAT" and put it in your
Windows or WinNT folder ...

@echo off
c:
cd "C:\!My Backups\OldMSDOS"
help.com


Then just type DOSHELP from a dosbox prompt. Enjoy the nostalgia!

Winguy
 
Back
Top