List files with path and file size only in Command Line

command-line, command-prompt, filenames, powershell, windows

Solution

Get-ChildItem -Recurse | select FullName,Length | Format-Table -HideTableHeaders | Out-File filelist.txt

Problem

Windows Command Line (or maybe PowerShell). How can I list all files, recursively, with full path and filesize, but without anything else and export to a .txt file. Much preferably a code that works for whichever current directory I am in with the Command Line (so does not require manual entering of the target directory). None of these provides path\filename and filesize only: ``` dir /s > filelist.txt dir /s/b > filelist.txt dir /s/o:-d > filelist.txt ``` Desired output (fullpath\file.ext filesize): ``` c:\aaa\file.ext 7755777 c:\aaa\bbb\1.txt 897667 c:\aaa\bbb\2.ext 67788990 c:\aaa\bbb\nnn\a.xls 99879000 ```

Original source

Related problems