Angabe des Pfads aller Dateien bei der Verzeichnisauflistung

2616
dplante

(In Windows / Befehlszeile) Ich möchte eine Liste aller Dateien erstellen und für jede Datei möchte ich auch den vollständigen Pfad anzeigen.

Wenn Sie also eine Verzeichnisauflistung des Ordners c: \ users \ me machen und die Dateien a.txt, b.txt und c.txt hätten, würde ich die folgende Ausgabe wünschen:

... c:\users\me\a.txt c:\users\me\b.txt c:\users\me\c.txt ... 

Kann jemand ein Tool vorschlagen, das dies tut, oder muss ich das wirklich tun?

2

2 Antworten auf die Frage

2
John T

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.

Vielen Dank!!!!!!!!!!!!!!!! das ist genau das, wonach ich gesucht habe (ich weiß über / s, ich wusste nicht, / b wäre hier nützlich) danke! dplante vor 14 Jahren 0
1
Joey

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"