user3437212
user3437212

Reputation: 675

How to list files in windows with full pathname

I'm trying to list files in a directory at sub-folder level

I'm doing

dir /s path

example output

Is there any way possible that we can list the file full path name like below

M:\admin_view\GemBalancing\AllocationAndBalancing\AnalysisAndDesign\SUC\Report\BalancingSurveyReportSUCS.doc

Upvotes: 0

Views: 281

Answers (2)

mordecai
mordecai

Reputation: 71

You need a batch file for that ... The following code should work

@echo off

Cd\

For /r %%a in (*) do (

Echo %%a>>all_files.txt

)

Upvotes: 0

Prix
Prix

Reputation: 19528

What you want is the /B option:

/B Uses bare format (no heading information or summary).


Using:

dir /S /B path

You will get the folder recursively with the full path everywhere.


Using:

dir /S /B /A:-D path

You will get a list of files only from all directories within.


You can read the other options and what they do by using the command:

dir /?

Upvotes: 4

Related Questions