0

I have searched for this everywhere so I hope it has not already been asked, but I have a batch file where the user can write his / her own 'scripts' if you will. When the batch file is ran for the first time it will make a directory under %appdata%\Mellow\Mango\scripts and these scripts will simply be .txt files. Anyway...

I am trying to list the 'scripts' to the user by using dir /b /s *.txt and the output is C:\Users\Tate\AppData\Roaming\Mellow\Mango\scripts\template.txt

My question is, sorry if I got off-topic before, how to display only template.txt and not the full file path. I simply would like to list all .txt files contained in the scripts folder. Thanks in advanced!

Current Output:

C:\Users\Tate\AppData\Roaming\Mellow\Mango\scripts\template.txt
C:\Users\Tate\AppData\Roaming\Mellow\Mango\scripts\another_script.txt

Desired Output:

template.txt
another_script.txt
sociallymellow
  • 155
  • 1
  • 2
  • 14

1 Answers1

2

Simply remove the /s

dir /b *.txt

That should do it :)

Beatty
  • 456
  • 3
  • 10
  • Thanks for the quick answer! I could have swore I tried that before but I guess I only tried removing the /b and tried adding /x etc. Works perfectly now! (: Edit: I probably should have looked up what the /letters even meant now that I think about it aha. – sociallymellow Mar 27 '13 at 21:31
  • 1
    Happens to the best of us. Glad I could help. – Beatty Mar 27 '13 at 21:36