< Day Day Up > |
Using DIRThe DIR command, which lists files and folders in either the current or any other specified drive or folder, has many options that vary with the version of Windows used. To use the DIR command
Windows 9x/Me uses these options for DIR : A:/>DIR/? Displays a list of files and subdirectories in a directory. DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]] [/O[[:]sortorder]] [/S] [/B] [/L] [/V] [/4] [drive:][path][filename] Specifies drive, directory, and/or files to list. (Could be enhanced file specification or multiple filespecs.) /P Pauses after each screenful of information. /W Uses wide list format. /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 /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 (earliest first) G Group directories first - Prefix to reverse order A By Last Access Date (earliest first) /S Displays files in specified directory and all subdirectories. /B Uses bare format (no heading information or summary). /L Uses lowercase. /V Verbose mode. /4 Displays year with 4 digits (ignored if /V also given). Switches may be preset in the DIRCMD environment variable. Override preset switches by prefixing any switch with - (hyphen)for example, /-W. Windows 2000/XP adds the following options: /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. /N New long list format where filenames are on the far right. /Q Display the owner of the file. /T Controls which time field displayed or used for sorting timefield C Creation A Last Access W Last Written /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. Figure WCR.1 compares the default DIR output from Windows 9x/Me (top) with Windows 2000/XP (bottom). Note that Windows 9x/Me display the LFN only if a command prompt is opened within the Windows GUI. The options listed for DIR can be combined with each other, enabling you to use DIR to learn many different types of information about files and folders. The following are some examples:
Figure WCR.1. Default options for DIR with Windows 98 (top) compared to Windows XP (bottom). The 32-bit command interpreter (CMD) used by Windows XP uses long filenames by default.
|
< Day Day Up > |