Page 1 of 1

Need help with appending multiple dir commands

Posted: 17 Jun 2015 09:02
by machone
I've got this batch file which grabs a list from all subdirectories and then opens that list in TedNotepad. What I can't figure out is how to filter multiple wildcards.. each new line overwrites the previous so only the last one shows up. This is what I works:

Code: Select all

@echo off
dir /b /s "output*-*-*.raw" > composite.bat
start "" "D:\utility\TED Notepad 6\tednpad.exe" "composite.bat"


And this does not work, only shows the last 'dir' line:

Code: Select all

@echo off
dir /b /s "output*-*-*.raw" > composite.bat
dir /b /s "output*-*-*.obj" > composite.bat
dir /b /s "output*-*-*.bmp" > composite.bat
start "" "D:\utility\TED Notepad 6\tednpad.exe" "composite.bat"


Can someone help me out here..? It's probably something simple like adding an && between each one but I'm not sure how to go about it.

m1

Re: Need help with appending multiple dir commands

Posted: 17 Jun 2015 10:35
by taripo
Use >> for append.

> will just overwrite.

compare

echo asdf >file

echo adsfds>> file

Re: Need help with appending multiple dir commands

Posted: 17 Jun 2015 10:53
by machone
I had a feeling it was something simple, thank you!

m1