none
Get FileDateTime, FileSize, SourcePath, CreatedBy, ModifiedBy, DocumentName and separate with Tabs RRS feed

  • Question

  • Hello,

    the following command:

    dir /s /q >list.txt

    provides me almost all of the information I need to get a file listing, but I need it separated by tabs and I need to include the SourcePath, and (preferably) the CreatedBy and ModifiedBy UserName like this:

    FileDateTime, FileSize, SourcePath, CreatedBy, ModifiedBy, DocumentName (and separated with Tabs)

    Does anyone know how I can get this information for all folders and subfolders in a directory?

    THank you!


    John



    • Edited by vsla Thursday, February 5, 2015 1:11 AM
    Thursday, February 5, 2015 1:09 AM

Answers

  • Use PowerShell instead.


    PS C:\> get-childitem -recurse |
      select-object LastWriteTime,Length,@{Name="Path";
      Expression={split-path $_.FullName -parent}},Name |
      export-csv list.csv -notypeinformation
    


    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by vsla Thursday, February 5, 2015 5:53 PM
    Thursday, February 5, 2015 2:23 AM
    Moderator
  • Adding the owner is a little bit harder, but still possible:


    get-childitem -recurse |
      select-object LastWriteTime,Length,
      @{Name="Path"; Expression={split-path $_.FullName -parent}},
      Name,
      @{Name="Owner"; Expression={(get-item -literalpath $_.FullName).GetAccessControl().Owner}} |
      export-csv list.csv -notypeinformation
    


    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by vsla Thursday, February 5, 2015 7:15 PM
    Thursday, February 5, 2015 6:44 PM
    Moderator

All replies

  • Use PowerShell instead.


    PS C:\> get-childitem -recurse |
      select-object LastWriteTime,Length,@{Name="Path";
      Expression={split-path $_.FullName -parent}},Name |
      export-csv list.csv -notypeinformation
    


    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by vsla Thursday, February 5, 2015 5:53 PM
    Thursday, February 5, 2015 2:23 AM
    Moderator
  • Mr. Stewart:

    You are awesome!

    Thank you!

    John


    John

    Thursday, February 5, 2015 5:57 PM
  • Mr. Stewart, to get the owner, do I merely put "owner" in like this:

    get-childitem -recurse |  select-object LastWriteTime,Length,@{Name="Path";  Expression={split-path $_.FullName -parent}},Name,Owner |   export-csv list.csv –notypeinformation

    Thank you again!


    John

    Thursday, February 5, 2015 6:33 PM
  • Adding the owner is a little bit harder, but still possible:


    get-childitem -recurse |
      select-object LastWriteTime,Length,
      @{Name="Path"; Expression={split-path $_.FullName -parent}},
      Name,
      @{Name="Owner"; Expression={(get-item -literalpath $_.FullName).GetAccessControl().Owner}} |
      export-csv list.csv -notypeinformation
    


    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by vsla Thursday, February 5, 2015 7:15 PM
    Thursday, February 5, 2015 6:44 PM
    Moderator
  • Thank you so very much!

    John

    Thursday, February 5, 2015 7:15 PM