Basically, I want to list all the SQL files from a folder called Scripts. I am doing this in the following way:
dir /s /b "D:\Scripts\*.sql"
(I am specifying the full path as I want this to work from wherever I write this command)
This is showing me the list of files somewhat like:
D:\Scripts\subfolder1\foo.sql D:\Scripts\subfolder1\bar.sql D:\Scripts\subfolder2\baz.sql
I would like to print just:
foo.sql bar.sql baz.sql
Is this possible from a single command? Thanks in advance.