How do I recursively list filenames (only) in DOS/Windows?
--------------------------------------------------
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Industries in Orbit Looping
--
Chapters
00:00 Question
00:48 Accepted answer (Score 34)
01:22 Answer 2 (Score 8)
01:36 Answer 3 (Score 5)
02:02 Answer 4 (Score 3)
02:26 Thank you
--
Full question
https://superuser.com/questions/344155/h...
Question links:
[Get bare file names recursively in command prompt]: https://superuser.com/questions/294099/g...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#windowsxp #commandline #filenames #dir
#avk47
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Industries in Orbit Looping
--
Chapters
00:00 Question
00:48 Accepted answer (Score 34)
01:22 Answer 2 (Score 8)
01:36 Answer 3 (Score 5)
02:02 Answer 4 (Score 3)
02:26 Thank you
--
Full question
https://superuser.com/questions/344155/h...
Question links:
[Get bare file names recursively in command prompt]: https://superuser.com/questions/294099/g...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#windowsxp #commandline #filenames #dir
#avk47
ACCEPTED ANSWER
Score 34
cd /d C:\Path\To\Source\Folder
for /r %i in (*) do @echo %~ni
If you need the list saved to a file, append >> C:\Path\To\list_file.txt
to the end of the for
command.
If you end up wanting the extensions, change %~ni
to %~nxi
To use in a batch file, change all the %
to %%
ANSWER 2
Score 8
If you are willing to load powershell, this command should do it.
get-childitem "d:\acc" -recurse|foreach {$_.Basename}
ANSWER 3
Score 5
Doing something like the following should get you what you want:
@for /f "delims=" %a in ('Dir /s /b %systemdrive%') do echo %~na
Just pipe the output to a file and use it from there if needed.
ANSWER 4
Score 3
Don't know if you'd consider it a 3rd party software or not since it's form Microsoft and ships with 7, but powershell will solve most of your problem pretty easily. If you haven't already installed it, it's available for XP on Microsoft's site.
Get-ChildItem -path "C:\Program Files\" -recurse | foreach ($_) {
write $_.name
}