PSA Sorting NTFS files by time:date with greater granularity than seconds datestamp
2 views
Skip to first unread message
wolfgang kern
unread,
Mar 10, 2022, 12:14:43 PM3/10/22
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
PSA Sorting NTFS files by time:date with greater granularity than seconds
In the Windows 10 newsgroup today, I had asked how to sort a set of NTFS
files by a datestamp with greater granularity than seconds.
Below is the powershell suggestion from Andy Burns which worked the best in
my script which expects a list of files in LIFO order.
Run => powershell [control][shift][enter]
cd c:\filespec\
get-childItem | sort-object -prop lastWriteTimeUtc | forEach { "{0} {1}" -f $_.lastWriteTimeUtc.toString("yyyyMMddHHmmssffff"), $_.name }
Previous incarnations in reverse order of suggestion were the following.
get-childItem C:\ | forEach { echo $_.name, $_.lastWriteTimeUtc.toString("yyyy-MM-dd HH:mm:ss.ffff") }
dir /t:c /o:d /b > oldestontopnewestonbottom.txt