Sean's Windows command-line utilities These are just things I threw together for my own purposes. They have crappy documentation, they are poorly designed, and I don't guarantee that they won't trash your data--but they've never trashed mine. If you think they're useful, put 'em on your path. Normal people probably write these as 2-line perl scripts. recrun - recursive run command nocaps - change all-caps filenames to all-lowercase zerocheck - check for files that are all 0 (useful after crashes on NTFS) prepend - add a prefix to some files treemove - move files matching a wildcard spec, preservering a tree replace - in-place replace C identifiers on identifier boundaries recrun.exe Usage: recrun [options] {command} runs {command} in cwd (current working directory) and recursively in every directory below cwd If {command} contains the string "%d", then the command will be run for every directory, from the parent directory, with the name of the directory substituted for the %d (and surrounded by quotes). For example, 'recrun foo *' runs foo on all files (assuming foo process wildcards); 'recrun foo %d' runs foo on all directories. options: -d show directories as they're traversed -D show directory without newline (command should always print) -1,-2,etc. recursion limit to 1, 2, etc. dirs deep nocaps.exe Usage: nocaps {filespec} if a given filename is all-uppercase (or rather, it contains no lowercase letters and contains at least one uppercase letter), it is lowercased (all uppercase letters reduced to lowercase). Typical usage: recrun nocaps * zerocheck.exe Usage: zerocheck {filespec} Checks files to see if they contain all 0s. Prints files that contains all 0s, and prints summary counts ("mysterious" files couldn't be opened; usually they're directories). Typical usage: recrun zerocheck * prepend.exe Usage: prepend {filespec} {prefixstring} All files which match the {filespec} are renamed to being with {prefixstring}. treemove.exe Usage: treemove {srcdir} {destdir} {filespec} All files in the 'src' tree (recursively) which match {filespec} are moved to a corresponding tree (created automatically) in {dest}. replace.exe Usage: replace {src} {dest} [{filespec}] In-place search-and-replace of 'src' with 'dest', respecting C syntax rules, substituting only at identifier boundaries, does not substitute inside strings, DOES substitute inside comments. Default filespec if one is not provided is *.c and *.h. Useful for renaming types, global variables, structure fields, etc.--quick and easy refactoring.