In Windows I want to list the files from the drive in all the subfolders with the following attributes

  • From all the subfolders
  • File name
  • File Creation date
  • File Last Modified date
  • User name of last modifier of the file

I use the following command:

DIR /S /O:NS /T:CAW

and

/s gives all files in subfolders
/O:N gives name
/O:S gives file size

/T:C gives creation time
/T:W gives last modified time

My questions:

  1. Is this the correct way to use the command?
  2. How should I get the user name who modified/created the content last?

migrated from stackoverflow.com Nov 10 '11 at 3:43

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

The DOS command looks correct. However I use something like the following command and output my results to a text file so I can then review and use it:

dir "%windir%\*.*" /a:-d /o:ns /t:ca /s >files.txt

I also like to insert the /b switch however no timefield info will display.

Change the filter <path>\*.* if you like including the full path &/or from the current directory to be something more specific.

  • Thanks - How should I get the suer name who last modified the file – user549432 Nov 10 '11 at 2:57

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.