Cool Disk's

  
 Helping the Spread of Knowledge & Skill's...

Proud Member of the EyeTweaks Network

Welcome   
   Batch

HTML

Java

VB


Cmd

 

  

Special Thanks to Ours Sponsor's
How to become a sponsor

DIR Commands Section by Alan Mitchell
Using the Dir Command for directory / sub directories / file level listings.

These codes are safe to run and test on you pc they do not modify anything and only request data.  I have made an example for you to test to get started:

Go to Start, the Run, type cmd.  I prefer batch commands by saving the code in a txt file and renaming to .bat but that's another section of this site.

Example of Dir Command

Here are a few variations to the Dir list command.

List system files
dir /b /a:s /s > c:\list.txt

List hidden files
dir /b /a:h /s >c:\listh.txt

here's how it works. 

Dir "= directory", /b"=use bare format", /a"=display files wit the following attributes":="add the following attribute's"=system file list", /s"=Save",  > c:\list.txt = "save to the root of C:\, and call it list.txt".

Dir = displays a list of files or 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  
  h = hidden files  
  s = system files  
  r = read only files  
  a = files ready for achieving  
  - = prefix meaning not  
     
/b uses bare format (no heading info 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 (a-z)  
  E = by extension [a-z]  
  G = group directories first  
  S = by size (0-9)  
  D = by date/time  
     
/p pauses after each screnful of information.  
/q display the owner of the file  
/s display 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 display four digit years  
     
switches may be preset in the DirCmd environment variable.  override preset switches by prefixing any switch with - (hyphen) -- example, /-w

Note:  dir /? will pull up the help files on the command dir.
   

Submit your articles today to upabove@sbcglobal.net

Member of the EyeTweaks Network, We just keep on Tweaken!TM
CoolDisks.com All copyrights apply.(C)

Contact Us