The 'dir' command has a /T switch which selects whether to display the creation, access or modification time. However, it doesn't seem to be able to list files along with all three dates for each file -- how can I do this?
3 Answers
It is not possible in MS-DOS. You can only use one time field (C or A or W) for T at a time.
-
They’re not asking about DOS, they only added that tag erroneously instead of the
command-prompt
tag (which is redundant anyway since they already used thedir
tag). Besides, the title clearly says on windows.– SynetechSep 1, 2012 at 23:14
if you can use Powershell, ls | fl
(powershell ls^|fl from cmd
) will show those (among others). You can include only props you need:
ls | fl -prop name, creationTime,lastAccessTime,LastWriteTime
.
Use ls | get-member
to see available properties
-
get-childitem d:\temp -rec | where {!$_.PSIsContainer} | >> select-object FullName, LastWriteTime, creationTime, lastAccessTime, Length | export-csv -notypeinformation -delimiter '|' -path file.csv
will do same recursively– bendeckoFeb 11, 2021 at 15:51
You can’t do that with the Windows command-prompt itself; it only supports a single timestamp column, but you could try third-party alternatives like 4DOS or Console (formerly known as Console 2). In fact, open-source ones like Console are best because you can request the feature (technically Console doesn’t replace the command-interpreter itself, but I’m sure they can extend some commands like this).