+ALL +Introduction Program: ! (BANG !) version 2.98 (C) Copyright 1988-90 PC TECHniques/William J. Claff. All rights reserved. -Introduction +Purpose .Smajor Purpose: To provide a variety of powerful and flexible hard-disk management functions. These functions are provided in one utility with a consistent command syntax and options. -Purpose +Overview .Smajor Overview: ! is an information utility designed especially for hard-disk users. It provides enhanced versions of the following DOS commands: CHKDSK DIR TREE The enhancements include: The ability to search across several or all disk drives. Optional file selection criteria such as date or size. Optional sorting by any field. Optional arbitrary formatting of the output lines. Optional execution of the formatted output lines. CHKDSK of network drives. /P (pause) option supports any number of screen lines. /W (wide) option supports any number of screen columns. There are also several additional commands: DUP List only filenames that occur more than once. DUPCMD List only commands occuring multiple time on the PATH. FREE An abbreviated CHKDSK showing total and free space. LABEL List volume label(s). LS Similar to DIR. Alphabetical list of filenames only. UNIQUE List only filenames that occur once. WHERE Similar to DIR but also searches subdirectories. -Overview +ShareWare .Smajor ShareWare: This program is copyrighted material being distributed as ShareWare. ShareWare gives you an opportunity to evaluate software before buying. If you use it beyond a reasonable evaluation period you should register. Registered users receive a copy of the latest release, additional documentation, telephone support, update notification and minor releases at cost. +Registering .Sminor Registering: To register send your payment of $30 to: William J. Claff 7 Roberts Road Wellesley, MA 02181 Massachusetts residents add 5% sales tax. Boston Computer Society members deduct 10% before tax if any. Write for details on volume discounts and site licenses. For your convenience there is an order form in the file named order. To print the form use the DOS command: copy order prn If your printer is not attached to prn substitute the appropriate device. For example, LPT2. -Registering +Distributing .Sminor Distributing: Individuals and ShareWare libraries are encouraged to copy and distribute this program with the following restrictions: * All files are distributed together and no file is modified. * Only a customary and usual copying fee may be charged. * The label indicates that the diskette contains copyrighted material. * There is no representation that the software is free or in the public domain. -Distributing +Warranty .Sminor Warranty: This program is provided on an 'as-is' basis. No warranty is expressed or implied. We are not responsible for any direct or consequential damages due to incorrect operation. -Warranty -Shareware +Syntax .Smajor Syntax: ! SUBCOMMAND SEARCH SELECT SORT FORMAT OPTION No parameters are required. If you provide a SUBCOMMAND, it must be the first parameter. The other parameters can be in any order you choose. -Syntax +SUBCOMMAND .Smajor SUBCOMMAND: The following SUBCOMMANDs are available: CHKDSK Similar to DOS CHKDSK. DIR Similar to DOS DIR. DUP List only filenames that occur more than once. DUPCMD List only commands occuring multiple time on the PATH. FREE An abbreviated CHKDSK showing total and free space. LABEL List volume label(s). LS Similar to DIR. Alphabetical list of filenames only. TREE Similar to DOS TREE. UNIQUE List only filenames that occur once. WHERE Similar to DIR but also searches subdirectories. If no SUBCOMMAND is provided, the default SUBCOMMAND is DIR. -SUBCOMMAND +SEARCH .Smajor SEARCH: The SEARCH specification indicates which files to get from DOS. SEARCH is similar to a DOS file specification. SEARCH has three parts: SEARCH-DRIVE, SEARCH-DIRECTORY and SEARCH-FILENAME. The combination of drive and directory is also known as a path. The components of a SEARCH specification is easiest to explain with an example: C:\DOC\RESUME.TXT In this example: SEARCH-DRIVE is C: SEARCH-DIRECTORY is \DOC\ SEARCH-FILENAME is RESUME.TXT C:\DOC\ is the path. +SEARCH-DRIVE .Sminor SEARCH-DRIVE: The SEARCH-DRIVE is a letter followed by a colon ':'. Multiple drive letters separated by colons ':' are allowed. A star '*' indicates an automatic search for all hard-disks. Some examples of SEARCH-DRIVE are: C: The C drive C:D: The C and D drives *: All hard-disk drives If the automatic search does not produce the desired results, you can change the meaning of * with the !.* environment variable. Suppose your hard-disks are c: and d: and you have a ram-disk that looks like a hard-disk as e:. If you don't want e: searched automatically, put the following line in your AUTOEXEC.BAT file: set !.*=CD -SEARCH-DRIVE +SEARCH-DIRECTORY .Sminor SEARCH-DIRECTORY: SEARCH-DIRECTORY starts with a backslash '\', dot '.' or dot-dot '..'. \ indicates starting at the root directory. . indicates starting at the current directory. .. indicates starting at the parent directory. The SEARCH-DIRECTORY ends at the rightmost backslash '\' unless the filename to the right is a subdirectory. For the example: c:\wp\doc SEARCH-DIRECTORY is \wp\doc\ if doc is a subdirectory of \wp\ otherwise SEARCH-DIRECTORY is \wp\ Because DOS makes this distinction for us it is common practice to omit the last backslash of directory names in DOS commands. -directory +SEARCH-FILENAME .Sminor SEARCH-FILENAME: SEARCH-FILENAME has the same syntax as a DOS filename. Some examples are: resume.txt *.txt 88???31.txt The part to the left of the dot '.' is called the name. The part to the right of the dot is the extension. Together they form the filename. The star '*' and question-mark '?' are called wild-cards. The star expands out to as many question-marks as are needed to complete the name or extension. So in the above example *.txt expands to ????????.txt. A question-mark matches any single character including trailing spaces. -filename +defaults .Sminor When any portion of the SEARCH specification is missing, a default value is used. The defaults depend on the SUBCOMMAND and can be summarized: SUBCOMMAND default drive default directory default filename ---------- -------------- ----------------- ---------------- CHKDSK current drive does not apply does not apply DIR current drive current directory *.* DUP all hard-disks root directory *.* DUPCMD does not apply does not apply does not apply LS current drive current directory *.* TREE current drive root directory does not apply UNIQUE current drive root directory *.* WHERE all hard-disks root directory *.* Multiple SEARCH specifications are allowed. DUPCMD uses PATH to determine all SEARCH criteria. SEARCH specifcations for DIR and LS must all be from the same path. UNIQUE requires exactly two SEARCH specifications. -defaults -SEARCH +SELECT .Smajor SELECT: SELECT lets you further restrict the files returned by SEARCH. The syntax for SELECT expressions is: (SELECT-FIELD.SELECT-COMPARE.SELECT-VALUE) For example to get only files with today's date use: ($D.eq.TODAY) In this example the SELECT-FIELD is $D, the SELECT-COMPARE is eq, and the SELECT-VALUE is TODAY. Use '.and.' and '.or.' to combine SELECT expressions. Parentheses can also be used to group combinations since in ungrouped combinations '.and.' is done before '.or.'. For example: (($S.eq.0).or.($S.gt.10000)).and.($D.eq.TODAY) This selects files with today's date and either a size of 0 bytes or a size greater than 10000 bytes. Only one SELECT expression is allowed. +SELECT-FIELD .Sminor The SELECT-FIELDs are: SELECT-FIELD description ------------ ----------- $N fileName without extension $E filename Extension $F entire Filename $S file Size in bytes $D Date of last update $T Time of last update $A Attribute -SELECT-FIELD +SELECT-COMPARE .Sminor The SELECT-COMPAREs for SELECT-FIELDs other than $A are: SELECT-COMPARE description -------------- ----------- EQ EQual GE Greater than or Equal GT Greater Than LE Less than or Equal LT Less Than NE Not Equal The SELECT-COMPAREs for SELECT-FIELDs $A are: SELECT-COMPARE description -------------- ----------- IS Has all of the attributes ISNT Does not have all of the attributes -SELECT-COMPARE +SELECT-VALUE .Sminor SELECT-VALUEs depend on the SELECT-FIELD. $N, $E and $F require an appropriate string of characters. Wild-cards are not allowed. $S requires a number. $D requires a date in the form yymmmdd. (eg. 88Jul28) The special values TODAY and TODAY-n (where n is a number of days) is allowed. $T requires a time in the form hh, hh:mm or hh:mm:ss where hh is hours (00 to 23), mm is minutes (00 to 59) and ss is seconds (00 to 59). For example, 13:30 is 1:30pm. Note, DOS only stores times as an even number of seconds so 13:30:31 is interpreted as 13:30:30. $A requires a one to four letter code consisting of: $A CODE description ------- ----------- R Read-only H Hidden S System A Archive -SELECT-VALUE -SELECT +SORT .Smajor SORT: SORT indicates the sort order of the output. Two examples are: +f Sort output by filename +s Sort output by file size The plus '+' indicates an ascending sort. 'f' stands for filename and 's' stands for file size. For a complete list see the SORT-FIELDs table below. Multiple SORT-OPTIONs are allowed. SORT-OPTIONs can be run together or separated by white-space. Each SORT is a SORT-ORDER immediately followed by a SORT-FIELD. The SORT-ORDER (usually a '+') is required for each SORT-FIELD. +SORT-ORDER .Sminor Use '+' for ascending and '-' for descending SORT-ORDER. -SORT-ORDER +SORT-FIELD .Sminor The SORT-FIELDS are: SORT-FIELD description ---------- ----------- P full Path including drive letter N fileName without extension E filename Extension F entire Filename S file Size in bytes D Date of last update T Time of last update -SORT-FIELD -SORT +FORMAT .Smajor FORMAT: FORMAT gives you control over what the output looks like. For example: "$N$E size=$S" lists only the name, extension and size of each file. It also puts the string ' size=' between the extension and size. The FORMAT specification must be in quotes. Each output line uses the FORMAT string as a template. Each '$' in the FORMAT string marks a 2-character FORMAT-FIELD. The replacements for the FORMAT-FIELDs are: +FORMAT-FIELD .Sminor FORMAT-FIELD description ------------ ----------- $P full Path including drive letter and '\' $N fileName without extension $E filename Extension $F entire Filename $S file Size in bytes $D Date of last update $T Time of last update $A file Attributes $$ dollar sign '$' $B vertical Bar '|' $C Closing square bracket ']' $G Greater than sign '>' $L Less than sign '<' $O Opening square bracket '[' $Q eQual sign '=' $R carriage Return $S has leading spaces, making it 8 characters long. -FORMAT-FIELD +FORMAT-FORMAT .Sminor Certain fields can be followed by a FORMAT-FORMAT. A FORMAT-FORMAT is enclosed by square brackets. $P can be followed by a FORMAT-FORMAT with either a '+' or a '-' between the square brackets. This controls whether the path will have a trailing backslash ('\'). A plus ('+') indicates a trailing backslash and a minus ('-') indicates no trailing backslash. The default is to include the trailing backslash. $N and $E can be followed by a FORMAT-FORMAT of the form [w] where w is the desired width of the field. If w is negative the result is left justified. For example, the FORMAT-FORMAT for a DOS DIR style output line would contain: $N[-8] $E[-3] $D can be followed by a FORMAT-FORMAT where certain groups of characters have special meanings. Examples of these meanings can be summarized: Code Example Description ---- ------- ----------- d 1 Day dd 01 Day with leading zero if necessary ddd Mon Three letter day of week dddd Monday Day of week m 1 Month mm 01 Month with leading zero if necessary mmm Mar Three letter month mmmm March Month yy 89 Two digit year yyyy 1989 Year Examples of FORMAT-FORMAT for dates include: $D[dddd mmmm d, yyyy] Sunday July 22, 1989 $D[mm-dd-yy] 07-22-89 $T can be followed by a FORMAT-FORMAT where certain groups of characters have special meanings. Examples of these meanings can be summarized: Code Example Description ---- ------- ----------- h 1 Hour hh 01 Hour with leading zero if necessary m 1 Minute mm 01 Minute with leading zero if necessary s 1 Seconds ss 01 Seconds with leading zero if necessary i a One character AM or PM indicator ii am Two character AM or PM indicator The leading character of the i code affects the case of the indicator. Hours are treated as military time unless the an i code is present. Examples if FORMAT-FORMAT for times include: $T[hh:mm:ss] 23:40:18 $T[hh:mm II] 11:40 PM -FORMAT-FORMAT -FORMAT +OPTION .Smajor OPTION: OPTIONs are miscellaneous switches. Each OPTION begins with a slash '/'. The OPTIONs are: OPTION description ------ ----------- /? Help /E Execute with Verification (short for /EV) /EL Execute and List (list each line) /EQ Execute Quietly (do not list lines) /EV Execute with Verification /P Pause when screen fills /V Verbose (show interpretation of parameters) /VV Verbose with Verification (confirm before continuing) /W Wide (list across width of the screen) /WP WordPerfect (restrict to WordPerfect files) +Help .Sminor Help: The help option (/?) is used to view or print the online documentation. You can obtain online documentation on any topic by entering: ! /?topic where topic is one of the section names in the online documentation. To produce a list of the section names in outline form use the command: ! /?? The special section name ALL is used to refer to the entire manual. To print the entire manual use the command: ! /?ALL > prn This command uses DOS redirection to send the output to the device prn. If the printer is not attached to prn substitute the appropriate device. To viewing help on the screen it is not necessary to use the /P option. /? automatically does a /P for you UNLESS you are redirecting output. -Help +Execute .Sminor Execute The execute options (/E,/EL,/EQ,/EV) allow you to execute the output as DOS commands. The execute option is always used in conjunction with FORMAT. To delete all of the .bak files on all hard-disks, use the command: ! WHERE *.bak "del $p$f" /EL /EL means that each line will be listed on the screen before it is done. If /EQ were used the lines would not be listed as they execute. The option /EV will prompt for verification (yes or no) before executing the line. This way you could selectively delete the .bak files. ************************************************************************* * Use the /E options with care! It is a good idea to use /VV with them. * ************************************************************************* Another way of deleting all of the files on all hard-disks would be to have ! WHERE make a batch file and then to execute the batch file. For example: ! WHERE *.bak "echo del $p$f $g$g clean.bat" /EL clean Since $g stands for '>' the FORMAT is "echo del $p$f >> clean.bat". This technique is useful for making batch files that will be used repeatedly. Another reason to use this method is if the FORMAT cannot be executed from within ! because there is not enough memory. Note that multiple commands can be executed by using the $R FORMAT-FIELD. Also, commands executed by ! must not consume any memory. Typically the only way this can happen is with the PRINT command. The first time you run PRINT it installs a resident portion to handle the spooling. If you want to use PRINT simply put the line: PRINT /d:prn in your AUTOEXEC.BAT file. If your printer is not attached to prn then substitute the appropriate device. -Execute +Pause .Sminor Pause: The pause option (/P) prompts for continuation each time the screen is full. This gives you the opportunity to read the information before it scrolls off the top of the screen. /P knows about many kinds of displays with various numbers of lines per screen. If /P incorrectly determines the number of lines on your screen simply follow the /P option with the correct number of lines. If you have a 70 line screen that is not recognized properly you would use the option: /P70 This syntax is also used to indicate the number of lines per page on the printer if you are redirecting the help output. The default number of lines per page is 60. To send help to a printer with 88 lines per page use the command: ! /?ALL /P88 > prn -Pause +Verbose .Sminor Verbose: The verbose options (/V,/VV) help you verify that your parameters are correct. When the verbose option is set the program shows on the screen how it has interpreted the parameters. The /VV option will also prompt for verification (yes or no) before continuing. -Verbose +Wide .Sminor Wide: The wide option (/W) helps you get more information on your screen. /W puts as much information on each line as it can before going to the next line. /W can only be used when the FORMAT specifies a fixed length output. This restriction ensures that the columns will line up. /W knows about many kinds of displays with various numbers of columns per line. If /W incorrectly determines the number of columns on your screen simply follow the /W option with the correct number of columns. If you have a 132 column screen that is not properly recognized you would use the option: /W132 This syntax is also used to indicate the number of columns per line on your printer if you are redirecting the output. To send a Wide DIRectory to a printer with 120 columns per line use the command: ! DIR /W120 > prn -Wide +WordPerfect .Sminor WordPerfect: The WordPerfect option (/WP) restricts the selected files to WordPerfect Corporation files. /WP only recognizes the new WordPerfect Corporation file formats. It does not, for example, recognize WordPerfect 4.2 documents. To restrict your output to WordPerfect 5.0 documents use the option: /WP To locate all WordPerfect Corporation files use the option: /WPCORP You can also locate other specific WordPerfect Corporation files by using option(s) of the form: /WPext where ext is an extension from the WordPerfect Filetypes table below. For example, to find all dictionary and thesaurus files on a system: ! WHERE /WPLEX /WPTHS -WordPerfect +WordPerfect-Filetypes .SMinor WordPerfect Filetypes ext description --- ------------------------- ALL printer resource CB Column Block DRS Display Resource Set FIL overlay FILe HYC HYphenation Code module HYD HYphenation Data module HYL HYphenation Lex module LEX LEXicon (dictionary) MRS Macro Resource Set NB Normal Block PRS Printer Resource Set RB Row Block SET SETup THS THeSaurus WPD WP graphics screen Driver WPG WP Graphic WPH Help WPK Keyboard definition WPM Macro -WordPerfect-Filetypes -OPTION +Usage .Smajor Usage: +CHKDSK .Sminor CHKDSK: The CHKDSK SUBCOMMAND is similar to the DOS CHKDSK command. For example: ! CHKDSK displays a table showing the allocation of bytes for the current drive. Here is something that ! CHKDSK can do that DOS CHKDSK cannot: ! CHKDSK *: Display a usage table with totals for all hard-disk drives. Also, ! CHKDSK works for network drives while DOS CHKDSK does not. Unlike DOS CHKDSK, ! CHKDSK does not take any corrective action when problems with the File Allocation Table (FAT) are detected. When dealing with damaged FATs it is best to use an interactive utility which puts potentially damaging decisions in the hands of the user. -CHKDSK +DIR .Sminor DIR: The DIR SUBCOMMAND is similar to the DOS DIR command. For example: ! DIR lists the directory entries for the current directory. Note that filenames are displayed in lower-case making them more readily distiguishable from the upper-case directory names. Here are some examples of the things ! DIR can do that DOS DIR cannot: ! DIR *.doc *.txt ($D.eq.TODAY) +F Display .doc and .txt files with today's date alphabetically. ! DIR ($e.ne.bak) "copy $f a:\" /EQ Copy all files except .bak files to the a: drive without listing or prompting for verification. Note, unlike DOS DIR the number of files on the totals line does not include the subdirectories. -DIR +DUP .Sminor DUP: The DUP SUBCOMMAND help you to locate duplicate files. This can help you recover disk space used by extra copies of files. The full-blown usage is: ! DUP This will locate duplicate filenames across all of your hard-disks. You can check a specific drive. For example: ! DUP c: Another common usage is: ! DUP a:\*.txt c:\doc\*.txt This use will locate .txt files which are duplicated on the a: disk and on the c:\doc\ subdirectory. When using DUP in this way remember that DUP searches the entire subtree, not just the specified directory. -DUP +DUPCMD .Sminor DUPCMD: The DUPCMD SUBCOMMAND help you to locate conflicting commands. DUPCMD follows the PATH and finds .BAT, .COM and .EXE files with the same name. Like COMMAND.COM DUPCMD also looks in the current directory in addition to the PATH. This subcommand has only one form: ! DUPCMD -DUPCMD +FREE .Sminor FREE: The FREE SUBCOMMAND is an abbreviated CHKDSK. For example: ! FREE displays the total and free bytes for the current drive. Another typical usage would be: ! FREE *: which shows the total and free bytes for all hard-disks. -FREE +LABEL .Sminor LABEL: The LABEL SUBCOMMAND lists the volume label(s). For example: ! LABEL displays the label of the current drive. Another typical usage would be: ! LABEL *: which shows the volume labels for all hard-disks. -LABEL +LS .Sminor LS: The LS SUBCOMMAND is similar to the DOS DIR command. For example: ! LS lists the directory entries for the current directory. This command lists only the files and lists them in alphabetical order. Other examples of ! LS usage include: ! LS *.doc /W Alphabetical display all .doc files across the screen rather than in a column. ! LS *.txt +s Display the .txt files in order by filesize. -LS +TREE .Sminor TREE: The TREE SUBCOMMAND is similar to the DOS TREE command. For example: ! TREE lists the directory paths for the current drive. Here is something ! TREE can do that DOS TREE cannot: ! TREE *: +p This command produces a sorted list of all paths on all hard-disks. Note that for TREE the only SORT allowed is +p or -p. You can also get subtree listings. For example: ! TREE c:\doc -TREE +UNIQUE .Sminor UNIQUE: The UNIQUE SUBCOMMAND help you to determine whether there are filenames that occur only once between two directories. Imagine you have a new version of a program on a floppy disk that you already have installed as c:\program. The command: ! UNIQUE a:\ c:\program will tell you which files, if any, are only on the floppy or on the hard-disk. -UNIQUE +WHERE .Sminor WHERE: The WHERE SUBCOMMAND locates files. It can operate on all of your hard-disks or on selected portions of your disks. Some examples of WHERE usage are: ! WHERE resume.txt locates all copies of resume.txt across all hard-disks. ! WHERE c:d:\*.txt e:\doc\*.txt +F produces a sorted list of the .txt files on the c: drive, d: drive and in the \doc\ directory tree of e:. ! WHERE *.bak "del $p$f" /EL Deletes all of the .bak files on all hard-disks. It lists the lines as it executes them but does not prompt for verification. -WHERE -Usage +Limitations .Smajor +DOS2 DOS2: Under DOS 2.0, if you rename the program or if the program is not on the PATH, you will not be able to locate the help file. -DOS2 +Sorting Sorting: The maximum number of files that can be sorted is determined by the amount of free memory. On 640K systems the limit is approximately 14000 files. When +P or -P is the first SORT-FIELD, the files are sorted on a per directory basis. -Sorting +Switchar Switchar: ! Bang uses the DOS SWITCHAR to determine which letter to use as the leading letter of options. If you have set SWITCHAR to '-' (in order to use '/' in filenames) you will not be able to specify decending sorts. -Switchar +TSRs TSRs: It is unwise to execute any Terminate and Stay Resident programs (TSR) from within any program, including !. If you execute any TSR from ! you will get the error message: Fatal Error in MemRestoreHuge when control returns to !. See the section on Execute regarding the DOS PRINT command. -TSRs -Limitations +Installation Installation Copy the contents of the floppy diskette to your hard-disk. Keep the files together or ! will not be able to locate the help file. Under DOS 2.x the program must not be renamed and must be on the path to locate the help file. -Installation -ALL