List every file with full paths using dir /s /b
The classic bare recursive file list of CMD — the input format every batch for-loop expects.
01Command
$ dir C:\Proj\*.ps1 /s /b02What it does
/b (bare) suppresses the header, size columns, and summary, and combined with /s it prefixes each hit with its full path — perfect for redirecting into a text file or consuming in for /f. Add /a:-d to exclude directories from the output. It's often faster and simpler than writing a PowerShell one-liner when all you need is a path list.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- dir | Microsoft LearnEvidence: Microsoft documents dir /s for subdirectories and /b for a bare list showing only file paths without headers or summaries.
- DIR - Windows CMDEvidence: SS64 notes /b strips headings and sizes leaving bare paths, and that /s /b output is ideal for feeding for-loops or redirection.
Last verified: 2026-09-17 · Category: Files & Folders
06Related solutions
Diagnose NTFS file system errors and bad sectors on any volume — including the system drive while Windows is running — before committing to a repair.
Robocopy is Windows' built-in robust file copier: use /MIR to keep a destination folder as an exact one-way mirror of a source, resumable and restartable.
One command that shows OS version, install date, boot time, memory, network adapters and installed hotfixes.