Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

(In Windows/Command line) I'd like to generate a list of all files, and for each file, I also want the full path displayed.

So if you were doing a directory listing of the folder c:\users\me and it had the files a.txt, b.txt and c.txt, I'd want the following output:


Can anyone suggest a tool that does this, or do I have to actually go code this?

share|improve this question
up vote 2 down vote accepted

As long as the directory doesn't have more directories in it, using the recurse option /s along with bare format /b will show the entire path with files:

dir /s /b

if there are more folders though it will display all the files in there as well. It's a neat little workaround though.

share|improve this answer
thanks!!!!!!!!!!!!!!!! that is exactly what I was looking for (I know about /s, I didn't realize /b would be useful here) thanks! – dplante Sep 25 '09 at 6:17

You can also use the for command, although it's a little more verbose:

for %x in (*) do @echo %~fx

The %~fx tells cmd to output a full path here.

forfiles also works here:

forfiles /c "cmd /c echo @path"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.