dir /s/b f:\*.mp3 > cdrom.m3u
Here is what is returned (sample).
f:\(AM Gold 1975) 02 Long Tall Glasses (I Can Dance) - Leo Sayer.mp3
f:\(AM Gold 1975) 03 Lady Marmalade - Labelle.mp3
f:\(AM Gold 1975) 05 Ballroom Blitz - Sweet.mp3
I'd like the f:\ to NOT show up after running this command.If that can't
be done, is there a way to strip the f:\ by another batch file? Any help
will be most appreciated.
Steve Baker
@echo off
for /f "tokens=*" %%a in ('dir /s /b f:\*.mp3') do call :strip "%%a"
goto :EOF
:strip
echo %~nx1>>cdrom.m3u
goto :EOF
--
u n z i p m y a d d r e s s t o s e n d e - m a i l
for /R f:\ %%I in (*.mp3) do echo %%~nxI>>cdrom.m3u
HTH
Clay Calvert
CCal...@Wanguru.com
Replace "W" with "L"
Steve Baker
I don't have an 'f:\' drive on my machine at home, so I had to change the names.
You can change them back to meet your requirements.
-------------------------begin screen capture WinNT 4.0 SP6a----------------------
C:\CMD>dir /s /b d:\junkdir\*.mp3
d:\junkdir\(AM Gold 1975) 02 Long Tall Glasses (I Can Dance) - Leo Sayer.mp3
d:\junkdir\(AM Gold 1975) 03 Lady & Marmalade - Labelle.mp3
d:\junkdir\(AM Gold 1975) 05 Ballroom Blitz - Sweet.mp3
C:\CMD>demo\stripname
C:\CMD>type %temp%\cdrom.m3u
(AM Gold 1975) 02 Long Tall Glasses (I Can Dance) - Leo Sayer.mp3
(AM Gold 1975) 03 Lady & Marmalade - Labelle.mp3
(AM Gold 1975) 05 Ballroom Blitz - Sweet.mp3
C:\CMD>qblist demo\stripname.cmd
===== begin file C:\CMD\DEMO\stripname.cmd =====
01. @echo off
02. for /f "tokens=*" %%a in (
03. 'dir /s /b d:\junkdir\*.mp3'
04. ) do call :strip "%%a"
05. goto :EOF
06. :strip
07. set rec="%~nx1"
08. set rec=%rec:&=^&%
09. echo %rec:"=%>>%temp%\cdrom.m3u
10. goto :EOF
===== end file C:\CMD\DEMO\stripname.cmd =====
-------------------------end screen capture WinNT 4.0 SP6a-------------------------
>In article <3BA9554F...@uclink.berkzipeley.edu>,
>pro...@uclink.berkzipeley.edu says...
>> Steve Baker wrote:
>>
>> > I'd like to make a directory listing in Win2000 without having the path
>> > show up in the text. Sorry if this is in a non-NT group, but I know
>> > someone knows the answer.
>> >
>> > dir /s/b f:\*.mp3 > cdrom.m3u
>> >
>> > Here is what is returned (sample).
>> >
>> > f:\(AM Gold 1975) 02 Long Tall Glasses (I Can Dance) - Leo Sayer.mp3
>> > f:\(AM Gold 1975) 03 Lady Marmalade - Labelle.mp3
>> > f:\(AM Gold 1975) 05 Ballroom Blitz - Sweet.mp3
>> >
>> > I'd like the f:\ to NOT show up after running this command.If that can't
>> > be done, is there a way to strip the f:\ by another batch file? Any help
>> > will be most appreciated.
>> >
>> > Steve Baker
If the files are all in the same folder then just leave out the /s
dir/b *.mp3 >index.m3u
-
Simon Sheppard
Web: http://www.ss64.com
email: Simon@ "
You asked this on Sept 10 (UK time), and were given, in News, a range of
answers. If you feel a need to ask again, you should explain why the
existing answers do not suffice. Or is it that you are using a badly-
implemented system, in your machine or at your chosen ISP, that repeats
messages?
Any scripted editor should be more than capable of removing the
superfluous characters.
Or is it that you do not understand this medium, and expect answers only
by E-mail?
BTW, this newsgroup, news:alt.msdos.batch, is not an NT newsgroup, and
posting NT questions here is inconsiderate.
--
© John Stockton, Surrey, UK. j...@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Steve