YourDictionary

DOS Dir - technical definition


An internal command for displaying the names of files within one directory. Widely used by Windows programmers and power users, following are the various Dir options (starting with DOS 5):

  dir        display all file names
  dir > prn  print all file names
  dir /w     across the screen (wide)
  dir /p     one screenfull at a time

  dir *.exe  all .EXE files

  dir /ad    only directories
  dir *.     only directories plus files
                without extensions

  dir /o     alphabetically (dirs 1st, files 2nd)
  dir /on    alphabetically (dirs & files mixed)

  dir /oe    alphabetically by extension (A to Z)
  dir /o-e   alphabetically by extension (Z to A)

  dir /os    from smallest to largest size
  dir /o-s   from largest to smallest size

  dir /od    from earliest to latest date
  dir /o-d   from latest to earliest date

  dir /ar    all read only files
  dir /ah    all hidden files
  dir /aa    all files ready for archiving
  dir /as    all system files



CHANGE DIR COMMAND DEFAULTS (As of DOS 5)
Use can change the defaults for the Dir command by setting the DIRCMD environment variable. The following example sets alpha order and a screenfull at a time:
     set dircmd=/o /p    change defaults
     set                 view current settings
     set dircmd=         restore defaults

Add the set dircmd= line in your AUTOEXEC.BAT file to change defaults each time you start.




link/cite print suggestion box