To print a folder’s file list, export the listing to CSV or text, open the saved file, and print it. Use CSV when you need separate columns for names, paths, sizes, and dates; use a plain text list when names alone are enough.
The commands below work in Windows PowerShell on Windows 10 and 11. Use a normal PowerShell window with access to the source folder. Administrator elevation is not required to list files you already have permission to read.
Export the folder’s files to a CSV inventory
Choose a source folder and a different output location. The example reads C:\Reports and writes a uniquely named CSV into your Documents folder, so the generated inventory does not become part of the source listing.
-
Open PowerShell
Open Start, search for PowerShell, and launch it normally. Paste the commands below after changing the source path to your actual folder.
$inventorySource = 'C:\Reports' $inventoryFile = Join-Path ([Environment]::GetFolderPath('MyDocuments')) ('file-list-' + (Get-Date -Format 'yyyyMMdd-HHmmss') + '.csv') $inventoryItems = @(Get-ChildItem -LiteralPath $inventorySource -File -ErrorAction Stop) $inventoryItems | Select-Object Name, FullName, Length, LastWriteTime | Export-Csv -LiteralPath $inventoryFile -NoTypeInformation -Encoding UTF8 $inventoryFile $inventoryItems.Count -
Open the saved inventory
Copy the printed output path and open that CSV in Excel or another CSV-capable application. Check a long filename and a name containing punctuation. CSV quoting keeps those values in their proper columns.
-
Check the result
Compare the number of data rows with the count PowerShell displayed. Check several FullName values and confirm Length is in bytes. The header is not a file row.
-
Print the inventory
Adjust column widths and page orientation in the application, then open its print preview. Ensure the full path column fits before printing or saving as PDF.
Get-ChildItem enumerates the files, while Export-Csv writes the selected properties. Do not put Format-Table before Export-Csv: formatting objects are not the original file records.
Include subfolders or hidden files deliberately
For files in all subfolders, replace the inventoryItems assignment with the following, then run the export and count commands again:
$inventoryItems = @(Get-ChildItem -LiteralPath $inventorySource -File -Recurse -ErrorAction Stop)
Add -Force only if hidden files should be included. It does not grant access to protected folders. If enumeration reports Access denied, resolve the permitted scope instead of claiming the output is complete.
Large network trees can take time. Use a small representative folder first, and avoid changing the source files while capturing an inventory whose count matters.
Save a simple filename list with Command Prompt
Open Command Prompt and replace the paths in this command. Keep the output outside C:\Reports and use a new filename if you need to preserve an earlier list.
dir /b /a:-d "C:\Reports" > "%TEMP%\reports-file-names.txt"
Open the text file from your temporary folder in Notepad and use Ctrl+P. Add /s to dir if you need full paths from subfolders. Microsoft’s dir reference explains the switches.
This text method does not provide the CSV’s separate size and date columns. Prefer the CSV procedure when names with non-English characters or a structured inventory are important.
Directory listing questions
Does this copy or change the source files?
No. The listing reads directory information and creates the output file in the chosen location. It does not copy file contents.
Why are folders missing from the CSV?
The -File switch deliberately selects files. Remove it only if you also need directory entries, and interpret their properties accordingly.
Why is my list incomplete?
Check the selected root, recursion choice, hidden-file scope, and any access error. A readable CSV is not proof every intended folder was successfully enumerated.