VOGONS

Common searches


First post, by ElBrunzy

User metadata
Rank Oldbie
Rank
Oldbie

Many ms-dos players dont support wildcard or dont have a frontend. I also dont want to use a shell to build playlist, or use a program to generate a playlist. I want a quick batch file that would list all files in a directory and call a software for each of them. I was never good at batch file and now that I try my luck, it's not a success at all 😠. Maybe someone more skilled than me could give me a hand ? I think my code would work in a more recent OS, but I'm not sure, the target anyway is msdos with command.com (no extender like 4dos). The problem seem to reside in the (fileset) of the FOR command. It look like in dos6.22 command.com want a file listto be here while I'd like to put a command like ("dir %2 /s /b/l") to seek subdirs.

Anyway here is what I've put up for now, if someone feel he can help?:

@echo %1 = soft to run
@echo %2 = directory to scan
@echo %3 %4 %5 = params to soft
@for /f %%f in ('dir %2 /s /b /l') do %1 %%f %3 %4 %5

let say the batch is name AP.BAT for AutomaticPlaylist(c), an example could be:
AP C:\ultrasnd\playmidi E:\midi\*.mid

Reply 1 of 1, by ElBrunzy

User metadata
Rank Oldbie
Rank
Oldbie

I cant beleive how dos 6.22 command.com was limited. Seem that everything I try dont work and the internet is full of people confusing cmd.exe and dos so it's not easy having help.
What I have been able to achieve is to call a player for every file type in the currect directory, obviously the "%2 = directory to scan" is removed in favor to current directory, with alot of batch processing or 2 paremeters I could successfully make a CD to the target, but cannot get back to the curdir as pushd/popd nor %cd% exist in msdos. Also no recursion as the msdos FOR dont understand /D and /F so it's too bad for this feature. I have few if any subdir in my music collection directory anyway. To randomize is out of question now. This attempt to build an automatic playlist is such a disaster. I've also did try another approach to pipe all files into a temp file to build the batch playlist and call it then, but you cannot treat each line separately that dir output or when you type a file... So here is as far as I could go, I think it can be quite useful tho:

@rem process each files (%2) in the current directory calling program (%1)
@rem eg (assuming you are on a dir with .mid files) : ap C:\players\dosmid\dosmid *.mid /opl
@echo %1 = soft to run
@echo %2 = filetype to scan
@echo %3 %4 %5 = params to soft
@for %%F in (%2) do %1 %%F %3 %4 %5

maybe I'll take a look at 4dos, I'm not sure if I remember hearing that he was smaller in base memory than command.com and offer better batch scripting tools, but does it interfer with demos and games? Damn next time I'll do some powershell I'll reflect upon how far we went since msdos command.com!