"Offering free computer help, hints, and tips to the Internet populace." Now with over 3,820 tips!

DOS and Batch Files

Forcing the Directory to Display a Certain Way

SUMMARY: Force the DIR command to display directories your desired way.


 

If you wish to set the directory listings a certain way (when you use the DIR command), set the DIRCMD environmental variable to the parameters you wish to use.

To see a list of possible parameters for the DIRCMD, see the list of possible parameters for the DIR command. Type

DIR /?

To set the DIRCMD environmental variable, add the line

SET DIRCMD=xxxx

in your AUTOEXEC.BAT file, replacing 'xxx' with the parameters you wish to use. For example, the parameter "/ON" would cause your DIR results to be automatically sorted by filename. The "/W" command automatically sets the DIR results to a wide-directory format.



Print This Tip

Get E-Mail When New Tips are Online

Return to the DOS and Batch Files page.

 


New in MalekTips:

RSS Feeds- Subscribe!

You want the latest tech tips and tricks in your e-mail Inbox - FREE? Type your e-mail address below and click 'Get Tips!'.
 


( sample / details )
( opt-out instructions )