Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

help modifying playlist script

Mar 28, 2012 11:11AM PDT

Hi I came accrossa script that I will put below, It creates a playlist file for titles that are located in the folder that the batch file is run from, It would be great if someone could help me modify it so that it can be run from within a folder containing numerous sub folders and create a playlist file in each of the subfolders with the playlist file consisting of just the files in each subfolder.
thanks in advance.


@ECHO OFFSET currentfolder="%cd%"CD ..SET upperfolder="%cd%"IF %upperfolder:~-2,-1%==\ SET upperfolder=%upperfolder:\=%CALL SET folder=%%currentfolder:%upperfolder:"=%\=%%CD %folder%TITLE Generating Playlist for %folder%ECHO.ECHO Start time: %time:~0,-3%ECHO Please wait...FOR /F "tokens=*" %%A IN ('dir /s /b *.mp3,*.wma,*.flac') DO CALL :loop "%%~A"GOTO end:loopSET file="%~1"CALL SET file2="%%file:*%currentfolder:"=%\=%%"SET file2=%file2:~0,-1%setlocal enabledelayedexpansion>>"%folder:"=%.m3u" ECHO !file2:"=!GOTO :EOF:endECHO End time: %time:~0,-3%ECHO PAUSE

Discussion is locked

- Collapse -
Re: script
Mar 29, 2012 8:43PM PDT

The fastest way to do this: copy the script to each of those subfolders and run there. Or did I miss something?

Kees

- Collapse -
re
Mar 30, 2012 12:06AM PDT

yes I can obviously do it that way but I would have to do this close to a 1000 times so quickest way, no I doubt it.

- Collapse -
Re: quick
Mar 31, 2012 6:16AM PDT

Well, you either spend time learning vbscript (and the methods of the filesystem object) or powershell and totally rewrite this batch file, or you start working. Or you find a programmer to do this for you. I'm afraid nobody here will do it for free.
Your choice.

Kees

- Collapse -
cheers
Mar 31, 2012 8:09AM PDT

I suppose if I asked how to say hello in french you would tell me to completely learn the language, thanks for your help, there is a forum which I contribute greatly on and I actually enjoy helping people, never have I thought about responding to peoples asking for help in this manner, what a %@*/ community spirit.

- Collapse -
Sorry, on this forum ...
Mar 31, 2012 8:44PM PDT

it's not customary to do someone elses work in detail. Just to give helpful hints and point to possible solutions.

Hello in French is "allo".

Kees

- Collapse -
I see forums that will do this work.
Apr 1, 2012 4:45AM PDT

Most of them have a BOUNTY that is paid when the code is given. Here we seem to focus on what we may have to learn to get this to work.

I'd try another scripting language since COMMAND.COM's batch language is very limited and while I used to take pride in making it do wild tricks I no longer bother. I'll skip all the hard work and re-write in a better script language when the need arises.
Bob