rWrap

rWrap is a simple utility for issuing repetitive commands on a given file mask recursively through a directory structure. I use it because I have setup files staggered across my drive that are used by the image gallery building tool; by issuing a command like the below, I can quickly edit all of the setup files:

rWrap gallery.ini notepad /file -nowait

The usage is very simple:

rWrap filemask commandmacro [options]

Here's what each element means:

filemask

This is a standard file mask and can be either specific (as in my example above) or can use wildcards (ie. email???.msg, *.txt, etc.). The command will be issued on any matching files in this directory or recursively below it. Note that commands are issued from the directory the file resides in.

commandmacro

This is the actual command you are going to run, with the filename being inserted in place of /file as you can see in my example. If you leave out the /file part, it will still work but it will issue "generic" commands (rather than file-specific ones) in any directory that contains file(s) of the given mask.

Note that you can also leave out the command altogether and assume Windows will figure it out. For example rwrap *.jpg /file -nowait will view all JPG files with whatever your default viewer is, and rwrap *.exe /file will sequentially execute all software (don't try that unless you know what to expect!).

options

Right now there is only one option available, and it's -nowait. By default, commands are run sequentially. That is, the program will wait for one command to finish before executing the rest. By using the -nowait option, all commands are in effect issued simultaneously as separate instances.


The program is pretty easy to use, but it's also quite powerful so please test it in small controlled environments (ie. when you know that only a few files will match the mask) to see how it works. Also be aware that scanning large directory structures for matches is not exactly fast. Oh, and it should go without saying that you need to install this in your path (you don't have to but it would be a pain to use otherwise).

This is of course free software. Copy it. Use it. Sell it. Edit it. Doesn't matter to me... but use at your own risk!

Shannon
contact info in sourcecode