• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Batch file question

Wisp

Junior Member
Background:
Infinity Engine games (Baldur's Gate, Icewind Dale etc.) stores its music as .acm files. There is a utility to be downloaded, which can convert .acm files into .wav files. Unfortunately the front-end that it comes with only supports converting one file at a time. Since there are quite a few of them (373 files in the case of BG2) this is obviously a rather inconvenient way to convert them all.

This brings us to my problem; I believe it is be possible to automate the process using a batch file. However, the similar batch files I found works by converting specified files (eg. A.acm->A.wav). To have it convert the file B.acm one would have to write a new entry for that file in the batch file. This would obviously be even less convenient. Using wildcards (* and %1) hasn't worked.

So I was wondering if there is a way to manage this in a smoother manner. Or must I resign myself to hour?s worth of tedious work?
 
It's definitely possible, cmd supports a for loop and the substitution that you'd want but I don't know how to do it off the top of my head since batch files suck so bad I avoid them as much as possible.
 
Something like this:

@echo off
FOR %%G IN (*) DO rename %%G %%G.foo

Would rename all the files in the current directory to 'file.foo', so you could just replace 'rename %%G %%G.foo' with 'convert %%G...', unless you need to strip the original file extention... if you do then think about using perl or a real programming language.
 
Back
Top