Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,501,580
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-29-24 03:56 PM
Guest: Register | Login

0 users currently in Computing | 1 guest

Main - Computing - Batch file help. New thread | New reply


The Kins
Posted on 03-31-07 05:12 AM (rev. 2 of 03-31-07 05:45 AM) Link | Quote | ID: 21249


Paratroopa
Level: 28

Posts: 48/140
EXP: 131264
Next: 74

Since: 02-19-07
From: AUSSIELAND

Last post: 5916 days
Last view: 5916 days
I can't remember how to write a batch file to automatically do commandline work of a whole bunch of files.

Here's what I want to do:

Check if a .xa file exists in the folder.
If so, get it's filename and execute XA2WAV (filename).xa (filename).wav
Delete the .xa
Rinse and repeat until there are no more .xa files

I'm pretty sure this is possible, but can't remember how to do it. Any suggestions?

PrinceKassad
Posted on 03-31-07 10:00 PM Link | Quote | ID: 21451


Level: 20

Posts: 1/60
EXP: 36718
Next: 5721

Since: 03-28-07

Last post: 5279 days
Last view: 5094 days
Quick 'n dirty set-up:

You need two batch files, scripter.bat and processor.bat.

The scripter.bat contains:


@echo off
for %%i in (*.xa) do call processor.bat "%%i"


The processor.bat contains:


@echo off
start /wait xa2wav %1 %1.wav
del %1


Save the two files either in C:\WINDOWS or C:\Windows\system32. Then, navigate to the folder where the .xa files are and run scripter.bat.

The only flaw I see is that the files are saved as [filename].xa.wav, I hope that it's no problem (if it is, I'd need to add some more code).

Main - Computing - Batch file help. New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.017 seconds. (321KB of memory used)
MySQL - queries: 37, rows: 47/48, time: 0.014 seconds.