CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

Windows – DIR command – How to control time fields display?

DIR command displays list of files and folders; also it displays the details about the file; like the size of the file, the date & time when it was last modified etc,.

Through this Article we will discuss about controlling time fields display.

DIR command can display 3 different types of date & time information of the files. It provides a switch “/t” to control the display of this information. Along with the switch “/t” you need to pass the of the below parameters to display the required date & time information of the files.

  • C – Creation Time of the file
  • A – Last access time of the file
  • W – Last written time of the file

By default DIR command displays the last written time information of the files. And also if we pass “/T” switch to it, it also displays the last written time information of the files. That means, below commands produce the same results.

C:\> dir

and

C:\> dir /t

and

C:\> dir /tw

To display the time when the files were created, you can pass the argument “C” to the switch “/T”. Below is the command.

C:\> dir /tc

Another time field Windows Operating System maintains for the files and folders is the last access time. We can get the last access time information, by using the “A” parameter with the switch “/t”. Here is the command.

C:\> dir /ta

Depending on your need you can use these details to display the required date & time information.

Be on learning path always!

// Malin

Windows – DIR command – How to control time fields display?

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top