Need help with appending multiple dir commands

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
machone
Posts: 31
Joined: 01 Oct 2012 18:36

Need help with appending multiple dir commands

#1 Post by machone » 17 Jun 2015 09:02

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

taripo
Posts: 228
Joined: 01 Aug 2011 13:48

Re: Need help with appending multiple dir commands

#2 Post by taripo » 17 Jun 2015 10:35

Use >> for append.

> will just overwrite.

compare

echo asdf >file

echo adsfds>> file

machone
Posts: 31
Joined: 01 Oct 2012 18:36

Re: Need help with appending multiple dir commands

#3 Post by machone » 17 Jun 2015 10:53

I had a feeling it was something simple, thank you!

m1

Post Reply