Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#289572 - 09/11/2006 04:51 Need DOS Batch (DIR command) help
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
Hey guys hows it going.. A friend had asked me some help with a dos batch file. he wanted one where he could enter the dir to scan for mp3's and put it into a text file. Here is the code:

Code:

@echo off

set /P dir=Directory: %=%
set /p file=Output File Name: %=%

dir /s /w /b %dir%\*.mp3 > %file%



Is there a way to get this to not show the dir's in front of the file names? Thanks guys!
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top
#289573 - 09/11/2006 07:29 Re: Need DOS Batch (DIR command) help [Re: SonicSnoop]
furtive
old hand

Registered: 14/08/2001
Posts: 886
Loc: London, UK
Replacing the /b flag with /n will remove the directory names from the file names, but will show the files in several columns rather than a single column. Don't know if this is any help
_________________________
Mk2a RioCar 120Gb - now sold to the owner of my old car
Rio Karma - now on ebay...

Top
#289574 - 09/11/2006 11:05 Re: Need DOS Batch (DIR command) help [Re: SonicSnoop]
JBjorgen
carpal tunnel

Registered: 19/01/2002
Posts: 3584
Loc: Columbus, OH
Try this:

Code:

@echo off

set /P dir=Directory: %=%
set /p file=Output File Name: %=%
FOR /R %dir% %%i IN (*.mp3) DO @echo %%~nxi >> %file%



It's slower, but should work.

EDIT: Also note that if the same output filename is used again, it will append to that file instead of overwriting it. That's pretty easily fixable though.
_________________________
~ John

Top
#289575 - 10/11/2006 23:24 Re: Need DOS Batch (DIR command) help [Re: JBjorgen]
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
Thank you for the replies! HE was able to get it where he wanted with these posts!
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top