Reputation: 675
I'm trying to list files in a directory at sub-folder level
I'm doing
dir /s path
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
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
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