home *** CD-ROM | disk | FTP | other *** search
- CHG 2.2
-
- A Program to Change
- File Attributes, Dates, and Times
- - and -
- Hide/Unhide directories
-
- by
- Bob Eyer
- [73230,2620]
-
- Feb 1, 1991
-
-
- Syntax:
-
- CHG Filespec|Directory [option-string]
-
- The option-string may be:
- - an attribute or combination thereof
- - a date
- - a time
- (see discussion below)
-
- Execution of CHG without parameters generates a useful help
- screen, returning a DOS error level of 1. Normal CHG terminations
- always return 0 for the error level.
-
- CHG, unlike ATTRIB and other replacements for DOS ATTRIB,
- emphasises the use of the absolute minimum number of keystrokes to
- run the program. Thus the option string is a cluster of letters
- (see below) indicating attributes to apply, rather than '-'
- and '+' signs associated with each attribute letter. CHG's focus
- on keystroke optimisation also overcomes a shortcoming in other
- programs of this type - to wit, their inability to handle
- filenames with dashes or underscores.
-
- Comments on Filename/wildcard:
- ------------------------------
- - The filename or wildcard argument may either have no drive or
- path specifiers or may be fully pathed, as in a filespec. With no
- path or drive information, CHG assumes the default drive and path.
-
- However, if the user wishes to change all files in the default
- path, he/she must either use the regular '*.*' wildcard format or
- the '.' shortcut, which is also supported by regular DOS commands.
-
- CHG also supports other normal DOS shortcuts, such as "..\."
- and "..\XYZ\." in place of the usual format for wildcards.
-
- New Feature:
- CHG now supports directories, but permits changing only the Hidden
- attribute of a directory or directory wildcard. Attempts to
- change other directory information are interpreted by CHG as
- instructions to reset the directory hide attribute, or leave it
- visible, if not hidden.
-
- Comments on the option-string
- -----------------------------
- There are three mutually exclusive types of option-strings:
-
- 1) Attribute-setting option strings.
- ---------------------------------
- These must contain the letters R, H, S, A, X, or D in any
- combination or order.
-
- These flags have the following meanings:
-
- D: Directory
- R: Read Only
- H: Hidden
- S: System
- A: Archive
- X: Reset
-
- Where the FIRST CHARACTER of the option string is D, it
- identifies the file as a directory. CHG supports directory
- wildcards as well as file wildcards.
-
- For both files and directories, CHG uses X for the reset
- function. However, the displayed attribute of a reset file
- or directory is always null.
-
- Where the user specifies the input filespec as a directory by
- using the D prefix on the option string, the directory
- attribute is omitted if the directory is reset (i.e.
- visible).
-
- Supported display attributes: R, H, S, A
-
- Directory examples:
-
- CHG . D :Reads the attributes of all sub-
- directories in the default directory.
-
- CHG work\*.* DH :Sets all subdirectories of \work to
- Hidden.
-
- CHG C:. D :Reads all subdirectories of C:\
- (same as CHG C:\. D)
-
- CHG C:SYS\. DH :Sets all subdirectories of C:\SYS to
- hidden (same as CHG C:\SYS\*.* DH)
-
- CHG . DX :Resets all subdirectories of the default
- directory.
-
- CHG ABC D :Reads attribute of subdirectory ABC.
- (No attribute will show if reset)
-
- CHG A*.* Dh :Sets all subdirectories beginning
- with A to Hidden.
-
- File examples:
-
- CHG XYZ R :Sets file XYZ to Read Only.
-
- CHG *.SYS RHSA :Sets all .SYS files to Read Only
- Hidden System Archive.
-
- CHG \SYS\*.DOC X :Resets all DOC files in the SYS
- subdirectory.
-
- CHG D:SYS\. H :Hides all files in C:\SYS
-
- CHG C:. :Reads all files in C:\
-
- What happens in default mode:
- ----------------------------
- Where the second parameter is omitted, or where the second
- parameter is simply a D, CHG simply displays attributes. In
- this mode, no change is made to files or directories.
-
- 2) Date-setting option-strings.
- ---------------------------
- If you wish to change the date of a file or series of files
- determined by a wildcard mask, just use your desired date in
- American slash format as your option-string.
-
- Examples:
-
- CHG RENAME.COM 2/1/89 :Changes RENAME.COM to 02-01-1989.
-
- CHG ABC TO/DAY :Changes ABC to current computer date.
- (i.e. to system date)
-
- Caveat:
- If you attempt to change the date/time stamp of a Read Only
- file, no date/time stamp change will occur.
-
- 3) Time-setting option strings.
- ---------------------------
- Here, CHG uses the colon (':') to recognise your option
- string as a time. CHG updates the time-stamp of a file to
- one-minute precision.
-
- Examples:
-
- CHG ABC.EXE 5:40 :Changes ABC.EXE to 05:40 A.M.
-
- CHG ABC.EXE 14:20 :Changes ABC.EXE to 02:20 P.M.
-
- CHG *.EXE right:now :Changes all .EXE files to current
- computer time (i.e. to system time).
-
- Caveat:
- If you attempt to change the date/time stamp of a Read Only
- file, no date/time stamp change will occur.
-
- Errors
- ------
- CHG 2.2 is much more adequately error-trapped than previous
- versions; and where an error occurs, processing terminates with a
- helpful diagnostic message and DOS error level of 1.
-
- DISCLAIMER:
- ==========
- This program is circulated as public domain without any guarantee
- or warranty; and the user, by downloading this program, or any
- variant thereof or by receiving it or any of its versions in any
- other form, agrees to accept full responsibility for its use. It
- is therefore understood that the user accepts this program or any
- previous version as is.
-
- Bob Eyer The author may also be reached at
- Compuserve [73230,2620] ROSE MEDIA 416-733-2285 (Main Conf)
- Toronto or
- Canada CANADA REMOTE 416-629-7044 (IBM Conf)
- -------------------------------------------------------------
- End of documentation.