Let's say, just for the sake of discussion, that you have an Xbox and you want to zip up all the roms in their own little zip files so that they take up less space, since nearly all the emulators will load roms from zip file, and perhaps because emulauncher currently demands that all extensions for a specific type of game be the same. Here's how you would do something like this in a bourne-compatible shell (like bash, ksh, ash, etc:)
for i in *.col; do zip -m "`echo $i | sed 's/\.col$/.zip/'`" "$i"; done
This example turns all the colecovision (.col) images in the current directory into zip files containing the original file, and deletes the .col file only if this process succeeds (the -m flag to zip.) I am doing this on Linux, but you can do it on Windows using Cygwin's bash shell, or in the Terminal on any version of Mac OS X. You'll need a zip program installed; on Windows install Info-Zip for Win32, on Mac OS X use Fink to install Info-Zip, and on Linux install the package called "zip" (usually) with your package manager of choice.
This can be done in the Linux on your system. Keep in mind that filenames are short on FATX filesystems. If you use a FATX Renamer.
')
for i in *.ws; do zip -m "`echo $i | sed 's/.\.ws$/.zip/'`" "$i"; done
The pattern matched in sed was changed from \.col
to .\.ws
— without going into a lesson on regular expressions, which I'm not really qualified to teach anyway, the dot character means "match any one character" unless it is preceded with a backslash. Then it just means a dot. In both of these commands we use a backslash to make sure that sed knows we're just looking for a literal dot, because it's the file's extension that we're working with. In the second example, we use a dot without a backslash, which means to match anything - so we're just going to throw away whatever character is there. In theory this could get you into trouble, because it's possible that this will produce a filename that is the same as another zip file which has already been created or which will be created, I'll talk about that in a second. The dollar sign is there to signify that we want to find these letters and dots and so on at the end of the string, which is where extensions are. We don't want to accidentally change some other part of the filename and end up with a really weird zip file name (even though it probably wouldn't hurt anything.)
If you DO end up with the zip file name being the same as another due to filename length or any other reason, one of two things should happen. The first and most likely scenario is that both ROM images end up in the same ZIP file, and as each one is added to the file, it is removed from the directory. I honestly don't know what happens when you try to load that zip - it probably varies by emulator, with some loading the first rom, and some offering you a choice. The alternative is that the operation will fail (although it shouldn't) and any roms which do not make it into an archive will end up sitting in the directory untouched (again, the behavior of the -m
flag.) You can do this as a two-part process where you first run the command WITHOUT adding the new dot character, letting any filenames which are too long fail when zip tries to open the output file, and then running it again with the dot, and avoid the problem completely, which is in fact precisely what I do. If you really wanted to, you could put the name of the new zip file into a variable, test to see if the zip file already exists, and then skip the file if it does, and thus avoid the errors... It might be sensible in a script, but it's a bit cumbersome on the command line.
The only other tip I really have for you here is specific to the emulauncher script. If you want to separate games of various types which are run by the same emulator (for example, some atari platforms, or game boy platforms) you have two options. Don't zip them, and put them all in the same directory, then create an entry for each type and distinguish them by their extension; this works fine for game boy, wonderswan... You can alternatively put each type of game into a directory somewhere, and then distinguish them by directory, perhaps zipping all the files and setting all the extensions to zip. This saves disk space and means you never have to remember what extension to use. In the case of games with multiple ROM files (e.g. for MAME) it's pretty much a necessity anyway. The more entries on your hard disk the slower any whole-disk operations or searches will be.
This particular scheme is exceptionally handy when you have Linux (XDSL, Xebian, xUbuntu, whatever) installed on your Xbox. You can fire it up, perform these file manipulation tasks which are impossible without a full operating system (at least, impossible right now) and then reboot to your dashboard as usual. In theory, it ought to be possible to add some more complex archive manipulation tools to the Xbox via the Python scripting functionality in Xbox Media Center, but this is not as straightforward as it sounds as ZIP is not implemented in python, and external libraries are required.
emulauncher is in a somewhat primitive state and it doesn't provide niceties like sorting of the emulator list. However, it is relatively simple to edit the config file and juggle the entries into some sort of rational order. Because the Notepad script is in even worse shape, you're best off either editing the file in Linux, or using FTP to copy it off of the system, edit it, and replace it.