searching with dir

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
alcool9999
Posts: 4
Joined: 17 Sep 2009 09:05

searching with dir

#1 Post by alcool9999 » 17 Sep 2009 09:09

hi
i need to get the names of all the files in a folder and all the files inside subfolders.
i want just the name of the files and not the path and i dont want it to list the sub folders just the files inside.

any help apreciated.
thanks

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 17 Sep 2009 09:22

Code: Select all

@echo off
set "rootdir=c:\your root folder"
cd /d "%rootdir%"
for /r %%a in (*) do dir /b /a-d "%%~a"

Post Reply