Global for Win32 (ver 1.0) Abandoned Freeware Steve P. Millers Global makes any application or utility recursive. It will recursively execute any command in the current directory and in all subdirectories under the current directory. Usage: global [/h] [/p] [/q] [/i] command [args ...] /h Process hidden/system directories. /p Prompt for each directory to be processed (Yes/No/All/Quit). /q Quiet mode. Does not display each directory name before processed. /i Ignore exit codes. Default is to exit if command returns non-zero. Global will execute any shell command, shell alias, or application, in the current directory and in all subdirectories under the current directory. Examples: global copy *.gif c:\gifs\ global if exist README start notepad README global /hi grep "TO-DO" *.c* *.h* | more By default, Global quits whenever a command it runs returns a non-zero return value. A non-zero return value from an application usually signifies an error. Use the /i option to force Global to ignore return values. At any time while Global is running, you can press CTRL+C or CTRL+Break to stop further directory processing. Note about piping and redirecting: The Global utility and the command it runs are usually treated as a single unit by the shell. This single unit is then attached to any pipe or redirection that you may be using. You may use quotes to group the command with the pipe or redirection to override the default behavior. Here are some examples: global /hi grep BUG *.c* *.h* > bugs.txt This example will create a single file named "bugs.txt" in the directory that Global was executed. To the shell, the command looks like the following: (global /hi grep BUG *.c* *.h*) > bugs.txt If you would like the redirection to occur on a per directory basis, you can group the command and the redirection in quotes. The following example will create a "bugs.txt" file in every directory that Global processes: global /hi "grep BUG *.c* *.h* > bugs.txt" To the shell, this quoted command essentially looks like the following: global /hi (grep BUG *.c* *.h* > bugs.txt) Overview of command line syntax (using FOO as the example program) ============================================================================= - Running FOO with a /? option will display the full command line usage. For example, "foo /?" will display the complete help screen for FOO. - All command line options can be specified with either a leading / or -. For example, "foo /?" is equivalent to "foo -?" - Options that do not take extra arguments can be grouped together. For example, "foo /s /h /r *" is equivalent to "foo /shr *" - Options that do take extra arguments can be placed at the end of a grouping. For example, "foo /s /h /r /t3 *" is equivalent to "foo /shrt3 *" - Spaces are optional between options and their arguments. For example, "foo /t3 *" is equivalent to "foo /t 3 *" FOO might take one or more filespecs. A filespec can be any combination of a file, path, directory, or wildcard search string. Here are some example filespecs: . matches all files in the current directory. * matches all files in the current directory. *.exe matches all files with ".exe" extension in the current dir. a*.xl? matches all files in the current directory that start with an "a" and end with ".xl" followed by any single character. readme matches a single file named "readme" in the current dir. c:\bin\* matches all files in the c:\bin directory. c:\bin\ matches all files in the c:\bin directory. c:\bin matches all files in the c:\bin directory. c:\bin\. matches all files in the c:\bin directory. c:\bin\readme matches a single file named "readme" in the c:\bin dir. d:* matches all files in the d: drive's current directory. \\server\share\* matches all files on the specified network share. If FOO takes filespecs, it also supports recursive directory processing. Just add a /s to the command line of FOO, and FOO will expand its file matching search to include all subdirectories under the initial directory for that filespec. For all the examples above, the /s option would repeat the search described for every subdirectory under the starting directory. FOO is smart enough to break apart the path portion of the filespec from the file or wildcard portion. A filespec like "/s c:\bin\readme" will find all files named "readme" in the c:\bin directory and in subdirectories under the c:\bin directory.