DOSKEY special characters DIR command display the list of files and subdirectories in a directory


Home | Order Online | Downloads | Contact Us | Software Knowledgebase

it | es | pt | fr | de | jp | kr | cn | ru | nl | gr

DOSKEY Special Characters

The following special characters can be used in macros to control command operations:


What is does


Redirects output – equivalent to the redirection symbol >


Appends output to the end of a file - equivalent to the append symbol >>


Redirects input - equivalent to the symbol <


Sends macro output to a command - equivalent to the pipe symbol |


Separates commands when creating macros or typing commands on the DOSKEY command line


Use for the $ sign

$1 to $9

Represents any command-line parameters that can be specified when the macro is run. Comparable with the %1 to %9 characters in batch programs


Represents command-line information that can be specified when macroname is written. $* is similar to the replaceable parameters $n except that everything typed on the command line after macroname is substituted for the $* in the macro.


Displays the list of Files and Subdirectories in a Directory.


DIR [drive:] [path] [filename] [/Switches]


What Is does


By default, DIR displays:

  • a header comprising the disk's volume label and serial number;
  • a list of all files and subdirectories in the current directory in the order they are listed in the FAT except those marked 'hidden' and/or 'system'. Along with each file/directory is its size, date/time of last modification, and long file name;
  • a footer comprising the total number of files listed, their cumulative size, and the free space (in bytes) remaining on the disk.

/A [attributes]

Displays files with and without specified attributes. Multiple attributes can be specified with no spaces between them.
attributes (Using the "-" as a prefix specifies "not")
        D              Directories
        R              Read-only files
        H              Hidden files
        A              Files modified since last back-up
        S              System files


List files in sorted order.
If order of sorting is not specified, directories are listed alphabetically followed by files, also listed alphabetically. Any combination of sorting order keys can be specified and files will be sorted in the order of the keys.
sortorder (Using "-" as a prefix reverses the order)
        N           By name (alphabetic)
        S            By size (smallest first)
        E            By extension (alphabetic)
        D            By date & time (earliest first)
        G            Group directories first
        A            By Last Access Date (earliest first)


Displays Files in the specified Directory and all its Subdirectories


Wide list format. File and Directory names are listed in 5 columns


Bare format. Files and Directories are listed in a single column without header, summary, or any details.


Output is in lowercase.


Pauses with each screen, full of information. Press any key to see the next screen.


Forces to Verbose mode. This displays attributes, date last accessed, and disk space allocated for each file, in addition to the standard information.


Long file names are not displayed in the file listing.


Displays the date as four digits rather than two.


The DIR command only accepts one path as a parameter. Long file and Directory names that include a space must be enclosed in inverted commas. You can also use wildcards such as * and ? to display a listing of a subset of files and subdirectories.

DIR can be used with the standard period (.) shortcuts to show higher level directories. If more periods are used than are required to show the root directory, the directories and files.

When using redirection to send the output of DIR command to a file or another command, it is often useful to use /A:-D to list only files, and /B to avoid extraneous information such as files sizes, headers and summary information. Also when the output of a DIR command is redirected via a pipe, a temporary file is created which is automatically deleted once the operation is completed.

By default, this temporary file is located in the directory specified by the "TEMP" environmental variable but, if this is not specified or cannot be found, it will be created in the current directory of the current drive. If the DIR command also refers to the current directory, any such temporary files will be picked up and included in the listing.

Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi
Data Recovery with & without Programming

Publishers of the Book
Number of Pages
Price of the Book

BPB Publications, New Delhi, India
$69.00 (Including Shipping Charges, Cost of Book and Other expenses, Free Source Code CD included with the Book)

Buy Data recovery Book

Previous page

page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15

Next page

© Copyright 2002-2005 DataDoctor.Biz

Home | Contact us | Downloads | Services | Terms and conditions | Site map

Website Data Recovery | recuperación de Datos | Récupération de données | Datenrettung | Recupero dati | データ復旧 | 데이터 복구 | 数据恢复 | Восстановление данных | De terugwinning van gegevens | Ανάκτηση δεδομένων
Sitemap Site map1 2 3 4 | Spanish1 2 3 | French1 2 3 | German1 2 3 | Italian1 2 3 | Portuguese1 2 3 | Japanese1 2 3 | Korean1 2 3 | Chinese1 2 3 | Russian1 2 3 | Dutch1 2 3 | Greek1 2 3
Data Recovery Book English | Spanish | French | German | Italian | Portuguese | Japanese | Korean | Chinese | Russian | Dutch | Greek