home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / utility / attr100.zip / ATTR100.DOC < prev    next >
Text File  |  1994-01-09  |  24KB  |  510 lines

  1.  
  2.  
  3.  
  4.                        ATTR Version 1.00 by Thomas Dyas.
  5.           A file attribute utility to replace the DOS ATTRIB command.
  6.             Copyright (C) 1994 by Thomas Dyas. All rights reserved.
  7.  
  8.  
  9.   Table of Contents
  10.   -----------------
  11.  
  12.   Introduction...........................1
  13.  
  14.   Registration Information...............2
  15.  
  16.   License Information....................2
  17.  
  18.   Installation...........................2
  19.  
  20.   What are file attributes?..............3
  21.  
  22.   Basic syntax of an ATTR command........3
  23.  
  24.   Viewing file attributes of a file......4
  25.  
  26.   Setting the attributes of a file.......5
  27.  
  28.   Command switches.......................6
  29.  
  30.   Special notes and tips.................8
  31.  
  32.   Technical Support......................9
  33.  
  34.  
  35.  
  36.   Introduction
  37.   ------------
  38.   ATTR is a utility designed to replace the ATTRIB command available in
  39.   MS-DOS. ATTR is a fully compatible superset of ATTRIB. You get all the
  40.   functionality of ATTRIB including the ability to:
  41.  
  42.     * View file attributes.
  43.     * Change one or more file attributes.
  44.     * Process files in subdirectories.
  45.     * Change directory attributes
  46.  
  47.   However, ATTR does more. With ATTR, you get the following new features that
  48.   the DOS ATTRIB command does not even offer:
  49.  
  50.     * Multiple filenames on the same command line.
  51.     * The ability to exclude certain filenames from processing.
  52.     * The ability to only process files with certain attributes.
  53.  
  54.   The only real difference between ATTR and ATTRIB is the action that occurs
  55.   when ATTR or ATTRIB is invoked without any command line arguments. ATTR will
  56.   show its help screen, while ATTRIB will list the attributes of all files in
  57.   the current directory. If you miss this feature, tell me when you register
  58.  
  59.   ATTR Documentation Page 2               Copyright (C) 1994 by Thomas Dyas.
  60.  
  61.  
  62.   and I will make an effort to change it!
  63.  
  64.   The only hardware and software requirements that ATTR needs is an IBM PC or
  65.   compatible running DOS version 2.0 or higher. In other words, ATTR will run
  66.   on any PC compatible available today.
  67.  
  68.  
  69.   Registration Information
  70.   ------------------------
  71.   ATTR is released under the Shareware concept. This means that this software
  72.   is NOT in the public domain. I still retain the copyright to ATTR. If you
  73.   find ATTR useful for any reason whatsoever, you must register it with me or
  74.   stop using the program entirely. Registration only costs $7 and allows you
  75.   to remove all of the annoying "Register Me" messages that the shareware
  76.   version of ATTR will display every time you use the program. The enclosed
  77.   file REGISTER.TXT contains all of the information you will need to register
  78.   such as my address and a form you can print out containing all of the
  79.   information that I need.
  80.  
  81.   You may only distribute ATTR if all of the files contained within the
  82.   archive are with the ATTR.EXE file. The reason for this requirement is
  83.   simple considering that people can only register ATTR with me if they have
  84.   the files that tell them how to register. The simplest method of
  85.   distribution would be to pass on the original archive!
  86.  
  87.   License Information
  88.   -------------------
  89.   The following paragraph is the license information for ATTR. By using the
  90.   ATTR program, you automatically agree to be bound this license.
  91.  
  92.   TKD Software and the author of ATTR, Thomas Dyas, disclaim all warranties
  93.   on the ATTR program, including all implied warranties of merchantability and
  94.   fitness. Furthermore, there are NO obligations or liability on the part of
  95.   Thomas Dyas or TKD Software or any other party for damages, including but
  96.   not limited to special, indirect, or consequential damages arising out of or
  97.   in connection with the use or performance of the ATTR program. By using the
  98.   shareware or registered forms of the ATTR.EXE program, you automatically
  99.   agree to be bound to all parts of this software license.
  100.  
  101.   Installation
  102.   ------------
  103.   By now, you have decompressed the archive that contains the ATTR.EXE program
  104.   file and the associated documentation files including this one. Just so you
  105.   can be thorough, here is a list of all the files that should be included in
  106.   the archive:
  107.  
  108.     * ATTR.EXE      This is the actual ATTR program. It IS the product. :)
  109.     * ATTR100.DOC   The main documentation file for ATTR.
  110.     * REGISTER.TXT  Instructions on how to register ATTR. Includes the
  111.                     registration form.
  112.     * FILE_ID.DIZ   A description file for BBS systems.
  113.     * READ.ME       A quick reference to the files in the ATTR archive.
  114.  
  115.   The only installation step is to copy the ATTR.EXE file into a directory
  116.  
  117.   ATTR Documentation Page 3               Copyright (C) 1994 by Thomas Dyas.
  118.  
  119.  
  120.   listed in your PATH environment variable. The PATH setting tells DOS where
  121.   to find program files that are not in the current directory. For example,
  122.   you would not be able to access external DOS commands if your DOS directory
  123.   was not listed in your PATH statement. The simplest way to install ATTR
  124.   would be to copy the ATTR.EXE file into your DOS directory. Once this is
  125.   done, ATTR is ready to be run from any directory!
  126.  
  127.   What are file attributes?
  128.   -------------------------
  129.   This is a good question since you cannot change what you don't know about.
  130.   Simply put, file attributes are special properties that DOS gives to a file
  131.   besides that file's name. Each attribute can either be on or off. At the
  132.   current time, there are four attributes available to files and directories.
  133.   The following list shows each attribute and what DOS and other programs use
  134.   it for. The letter that proceeds each description is the letter that ATTR
  135.   will use to refer to that attribute. All ATTR output and command line
  136.   arguments will use that letter to identify that attribute.
  137.  
  138.   A  Archive attribute- DOS uses this attribute to mark files that have been
  139.      modified since the last backup. Several commands such as XCOPY and BACKUP
  140.      can use this attribute to limit the number of files actually copied. When
  141.      a backup is done, this attribute would be turned off by the backup
  142.      program. DOS itself doesn't normally use this attribute. As you will see
  143.      in the Special Notes section, you can use this attribute to exclude files
  144.      from copying and other stuff.
  145.  
  146.   R  Read-only attribute- This attribute prevents a file from being deleted or
  147.      overwritten. Setting this attribute is a good way of protecting yourself
  148.      from accidentally deleting an important file! Some files that should have
  149.      this attribute would be COMMAND.COM, IO.SYS, and MSDOS.SYS. Files with
  150.      read-only status can be renamed however.
  151.  
  152.   H  Hidden attribute- Setting the hidden attribute will keep a file or
  153.      directory out of normal directory listings. This attribute will keep a
  154.      normal DIR command from displaying the file. However, the DIR /A command
  155.      under DOS versions 5.0 and higher will display a hidden file. Also,
  156.      hidden directories can still be accessed using the CD command.
  157.  
  158.   S  System attribute- This attribute is usually given only to the system
  159.      startup files IO.SYS and MSDOS.SYS. It identifies programs that are vital
  160.      to the system. IO.SYS and MSDOS.SYS fall into this category because they
  161.      ARE MS-DOS. System attribute files are hidden from normal directory
  162.      listings as if they were hidden. You never need to give your own files
  163.      this attribute.
  164.  
  165.  
  166.   Basic syntax of an ATTR command
  167.   -------------------------------
  168.   In all of the format lines that follow, anything surrounded by [] braces is
  169.   optional. A vertical bar | will separate items that are mutually exclusive.
  170.   You may enter only one item from this type of list and not any of the
  171.   others. Items separated by Items delimited by commas may be entered in any
  172.   order. You may also omit any of the items that you want from a comma list.
  173.   Finally, items listed in lower case describe a variable that you must
  174.  
  175.   ATTR Documentation Page 4               Copyright (C) 1994 by Thomas Dyas.
  176.  
  177.  
  178.   replace such as "filename". Here you would replace "filename" with the
  179.   actual filename that you want. Ellipses (...) mean that you can repeat the
  180.   previous sequence as many times as you want.
  181.  
  182.   Here is the basic format of an ATTR command:
  183.  
  184.   ATTR [ [+|-,A,R,H,S] [switches] [filespec] ] ...
  185.  
  186.   Notice that the entire command-line is optional. If you do not give ATTR any
  187.   parameters to process, it will display a small help screen. Of course, you
  188.   will probably be giving ATTR some parameters so that it does some actual
  189.   work! In this case, the most important parameter on the command-line is the
  190.   "filespec" parameter. The filespec tells ATTR what files it will access. You
  191.   can specify any valid path. You can include wildcards so that multiple files
  192.   can be accessed at once. Notice that the ellipses allow you to repeat this
  193.   entire block as many times as you want.
  194.  
  195.   The "switches" part of the command-line will be described later. Valid
  196.   command switches change the default behavior of ATTR and allow you to
  197.   exclude files and do other stuff. All switches must precede the filespec
  198.   they will affect. Finally, the section marked as "[+|-,A,R,H,S]" is the
  199.   parameter that will tell ATTR to begin set file attributes.
  200.  
  201.   ATTR operates in two modes. The first mode is to display the attributes of
  202.   each file that matches the filespec parameter. ATTR will continue in this
  203.   mode until you tell it to begin setting file attributes. Once ATTR begins to
  204.   set file attributes, you must use a command switch to reset it to the
  205.   attribute display mode. These two modes are simpler than you think. The next
  206.   two sections will explain all.
  207.  
  208.   Viewing Attributes
  209.   ------------------
  210.   When ATTR is in the attribute display mode, it will show a list of attribute
  211.   letters followed by the full pathname of a file. Each letter represents one
  212.   of the attribute letters that was listed in the chart above. Here is an
  213.   example command from my own hard drive:
  214.  
  215.   C:\> attr *.sys t*.bat command.com
  216.   ATTR V1.00   Copyright (C) 1993 by Tom Dyas. All rights reserved.
  217.  
  218.    .RHS  C:\IO.SYS
  219.    .RHS  C:\MSDOS.SYS
  220.    A...  C:\TPX.BAT
  221.    A...  C:\TC.BAT
  222.    .R..  C:\COMMAND.COM
  223.  
  224.   Notice that if an attribute is set, its letter will be shown. If the
  225.   attribute is not set, a period will appear. The full pathname of the file is
  226.   displayed directly after the attribute list. To display file attributes, you
  227.   just have to give ATTR a list of filespec's. Nothing is better than a few
  228.   examples.
  229.  
  230.   Examples of viewing attributes:
  231.  
  232.   ATTR Documentation Page 5               Copyright (C) 1994 by Thomas Dyas.
  233.  
  234.  
  235.   ATTR *.bat a:*.*
  236.    Shows the attributes of all .BAT files in the current directory and the
  237.    attributes of all files in the current directory on drive A.
  238.  
  239.   ATTR c:\bush*.com c:\windows\system\*.dll
  240.    Shows the attributes of all files that match BUSH*.COM in the root
  241.    directory of drive C, and the attributes of all .DLL files in the
  242.    \WINDOWS\SYSTEM directory on drive C.
  243.  
  244.   ATTR *.*
  245.    Shows the attributes of all files in the current directory.
  246.  
  247.   ATTR *.bat *.com *.exe
  248.    Shows the attributes of all .BAT, .COM, and .EXE files in the current
  249.    directory.
  250.  
  251.   ATTR ..\rat*.txt e:\qwerty.com b:kaka*.*
  252.    Shows the attributes of all files that match RAT*.TXT in the current
  253.    directory's parent directory, the attributes of the file QWERTY.COM in the
  254.    root directory of drive E, and the attributes of all files that match
  255.    KAKA*.* in the current directory of drive B.
  256.  
  257.  
  258.  
  259.   Setting the attributes of a file
  260.   --------------------------------
  261.   In order to change the attributes of a file, you must PRECEDE a file spec
  262.   with one or more attribute modifiers. Each modifier starts with a plus sign
  263.   (+) or a minus (-) followed by one or more of the four attribute letters.
  264.   Common sense tells you that the plus sign will set an attribute, while the
  265.   minus sign clears that attribute. The attribute modifiers will apply to all
  266.   filespecs that follow until you reset ATTR to the "view attribute" mode. As
  267.   ATTR changes the attributes of each file, it will display what attributes it
  268.   changed and the full path name of the file. Here is some sample output from
  269.   my own hard drive:
  270.  
  271.   C:\>attr +h -a p*.bat
  272.   ATTR V1.00   Copyright (C) 1993 by Tom Dyas. All rights reserved.
  273.  
  274.    A-..H+..  C:\PS.BAT
  275.    A-..H+..  C:\PSC.BAT
  276.  
  277.   Notice that each attribute being changed is followed by a plus or minus sign
  278.   signifying the type of change. In this case, the archive attribute is being
  279.   cleared while the hidden attribute is being set on both files. If you would
  280.   like to set or clear more than one attribute, you can combine the letters of
  281.   the attributes you want to set or clear into a single attribute modifier.
  282.   The following examples will clarify this point even further.
  283.  
  284.   Examples of setting attributes:
  285.  
  286.   ATTR +a *.*
  287.    Sets the archive attribute of all files in the current directory
  288.  
  289.   ATTR Documentation Page 6               Copyright (C) 1994 by Thomas Dyas.
  290.  
  291.  
  292.   ATTR -ar *.bak *.bat
  293.    Removes the archive and read-only attributes from all .BAK and .BAT files
  294.    in the current directory.
  295.  
  296.   ATTR -a -r *.bak *.bat
  297.    Same as the above command. Notice that the attribute modifiers are
  298.    cumulative. In other words, the modifiers "add up".
  299.  
  300.   ATTR +hr -a *.sys perot*.exe
  301.    This command will set the hidden and read-only attributes for all .SYS
  302.    files and perot*.exe files in the current directory. At the same time it
  303.    will clear the archive attribute for these files.
  304.  
  305.   ATTR -r a:\*.bat +a *.exe
  306.    The read-only attribute will be cleared from all .BAT files in the root
  307.    directory of drive A. Next, the read-only attribute will be cleared from
  308.    all .EXE files in the current directory as the archive attribute is being
  309.    set. Note that the "-r" does not go away simply because another modifier is
  310.    listed in the command. If you want to "clear out" the modifiers to start
  311.    "fresh", you must use a command switch.
  312.  
  313.  
  314.   Command switches
  315.   ----------------
  316.   ATTR accepts any number of command switches before a filespec so that you
  317.   can change the program's default behavior. You can exclude files from
  318.   processing and include files only with certain attributes. You can process
  319.   multiple directories recursively. You can also reset ATTR to the "view
  320.   attribute" mode. Command switches must PRECEDE the filespec that they modify
  321.   due to the way that ATTR processes the command line. Here they are in no
  322.   particular order:
  323.  
  324.   /?
  325.    Shows the ATTR help message. You can also display the help message by
  326.    invoking ATTR with no command line parameters. The message gives you a
  327.    quick help reference when you cannot refer to this file. This switch is
  328.    also provided since other programs such as the DOS 5+ commands use this
  329.    switch to display a small help screen.
  330.  
  331.   /S
  332.    This switch will cause ATTR to recurse through all of the subdirectories
  333.    under the next filespec. The /S switch only applies to the next filespec.
  334.    If you want it to apply to more than one filespec, you must specify /S
  335.    before each filespec in turn. Here are some examples:
  336.  
  337.    ATTR /s \*.*
  338.     Display the attributes of every file on the current drive.
  339.  
  340.    ATTR /s \tp\*.pas *.bak
  341.     This command will display the attributes of all .PAS files in the \TP
  342.     directory and any of the subdirectories under it. Then, the attributes of
  343.     all .BAK files in the current directory will be shown. The /S switch
  344.     doesn't apply to this second file spec since it wasn't specified right
  345.     before the filespec.
  346.  
  347.   ATTR Documentation Page 7               Copyright (C) 1994 by Thomas Dyas.
  348.  
  349.  
  350.  
  351.    ATTR +a /s a:\*.bat /s a:\*.com
  352.     This command will set the archive attribute of .BAT files on drive A. It
  353.     will also set the archive attribute of all .COM files on drive A since the
  354.     /S switch was specified before the second filespec.
  355.  
  356.   /V
  357.    This switch resets ATTR to the "view attribute". ATTR will stop setting the
  358.    attributes of files and begin to display file attributes starting with the
  359.    next filespec. You can also use this switch to "clear out" ATTR and give
  360.    ATTR entirely new attributes to set. Here are some examples:
  361.  
  362.    ATTR +r *.txt /v *.txt *.doc
  363.     This command will set the read-only attribute for all .TXT files in the
  364.     current directory. ATTR will then display the attributes for all .TXT and
  365.     .DOC files in the current directory. You get to see what a pretty job ATTR
  366.     did setting the read-only attribute.
  367.  
  368.    ATTR +r dvorak*.* /v +h *.plo
  369.     This command will set the read-only attribute on all files that match
  370.     DVORAK*.* in the current directory. The /V switch will reset ATTR to the
  371.     "view attribute" mode. ATTR will then set the hidden attribute for all
  372.     .PLO files in the current directory. The /V switch "cleared out" the "+r"
  373.     modifier. Since ATTR reads parameters from left-to-right the /V must come
  374.     before the "+h" to clear out the "+r". If it didn't, ATTR would also clear
  375.     out the "+h" and display the attributes of all .PLO files!
  376.  
  377.   /X[[:]exclude_path]
  378.    This command switch allows you to exclude files that match exclude_path
  379.    from processing. The /X switch will stay in effect for all filespecs that
  380.    follow it until you specify the /X switch again without any exclude_path.
  381.    The colon that comes between /X and exclude_path is optional. You can put
  382.    it in if you want. ATTR does not really care if you do. If you specify /X
  383.    without an exclude_path, ATTR will stop excluding files. Here are some
  384.    examples:
  385.  
  386.    ATTR /x:t*.* *.bat *.exe /x *.com
  387.     This command will show the attributes of all .BAT and .EXE files in the
  388.     current directory except for files that match t*.*. The /X switch alone
  389.     stops the exclude mode. ATTR will then show the attributes of all files
  390.     that match *.COM.
  391.  
  392.    ATTR +a /x*.com *.* a:\stuff\*.* /x /v /s b:\*.*
  393.     This command will set the archive attribute for all files in the current
  394.     directory and all files in the \STUFF directory of drive A except for
  395.     files that match *.com. ATTR will then show the attributes of all files in
  396.     all directories on drive B. This example is a good example of how the
  397.     switches can be combined.
  398.  
  399.   /I[A,R,H,S,-,+]
  400.    The /I switch will force ATTR to only process files that have certain
  401.    attributes. You can specify if the attributes must be on or off. This
  402.    switch is similar to the /A switch of the DIR command in DOS versions 5.0
  403.    or higher. The /I switch will remain in effect for all following filespecs
  404.  
  405.   ATTR Documentation Page 8               Copyright (C) 1994 by Thomas Dyas.
  406.  
  407.  
  408.    until you specify the switch again without any parameters. The attribute
  409.    letters that follow the /I switch must follow with no intervening space.
  410.    Each letter would force ATTR to accept only files with that attribute SET.
  411.    If the minus sign precedes an attribute letter, it will force ATTR to
  412.    accept files with that attribute CLEAR. Here are some examples:
  413.  
  414.    ATTR /ia-h *.* /ir *.sys
  415.     This command will display the attributes of all files in the current
  416.     directory that have the archive attribute and do not have the hidden
  417.     attribute. ATTR will then display the attributes of all .SYS files in the
  418.     current directory that have the read-only attribute.
  419.  
  420.    ATTR +a /ir a:\dev\*.com /v /x:psc.bat *.bat
  421.     This command will set the archive attribute for all *.COM files in the
  422.     \DEV directory on drive A that have the read-only attribute. ATTR will
  423.     then display the attributes of all *.BAT files in the current directory
  424.     that have the read-only attribute except for the file PSC.BAT. This is
  425.     another good combination example.
  426.  
  427.   /P-|+
  428.    This switch will turn the file protection feature on and off. By default,
  429.    ATTR will protect all files with the hidden AND system attributes from
  430.    having their attributes changed. This behavior is designed to protect the
  431.    MS-DOS startup files IO.SYS and MSDOS.SYS from attribute modification
  432.    unless you REALLY mean it. These two files normally have both the hidden
  433.    and system attributes. This is a safety feature. ATTRIB has this behavior
  434.    by default except that you must remove the system and hidden attributes
  435.    first. The protection switch is must simpler. Here is an example:
  436.  
  437.    ATTR -hs io.sys /p- io.sys
  438.     The first filespec will not remove the hidden and system attributes from
  439.     IO.SYS since protection is on by default. The second filespec will modify
  440.     the IO.SYS file since the /P- switch removes protection. If you want to
  441.     turn protection feature back on in the same command line use the /P+
  442.     switch.
  443.  
  444.   Special notes and tips
  445.   ----------------------
  446.   DIRECTORY ATTRIBUTES: The first special note regards setting the attributes
  447.   of directories. Using ATTR you can hide directories by giving them the
  448.   hidden attribute. The directories will not be visible in normal directory
  449.   listings unless the DIR /A switch is used. To set the attributes of a
  450.   directory, the filespec must match the directory name exactly with the
  451.   following backslash. You do not have to include the full pathname as in the
  452.   following examples if the directory is in the current directory. Treat the
  453.   directory as a file that you must name exactly. Here are some examples:
  454.  
  455.   ATTR +h c:\dos
  456.    This command will hide the \DOS directory on drive C.
  457.  
  458.   ATTR -h util
  459.    This command will "un-hide" the UTIL directory under the current directory.
  460.  
  461.   ATTR +h c:\dos*.*
  462.  
  463.   ATTR Documentation Page 9               Copyright (C) 1994 by Thomas Dyas.
  464.  
  465.  
  466.    This command will NOT hide the C:\DOS directory since the filespec does not
  467.    match the directory name exactly.
  468.  
  469.   USING THE ARCHIVE ATTRIBUTE TO EXCLUDE FILES WITH XCOPY: Using the archive
  470.   attribute with ATTR, you can use XCOPY to copy only certain files. First,
  471.   you must clear the archive attribute from all files in the directory you
  472.   want to copy. Next, set the archive attribute for all files you want to
  473.   copy. Then, use XCOPY with the /A switch or /M switch to copy only files
  474.   with the archive attribute. It may make your life much easier! Here is a
  475.   sample run without output:
  476.  
  477.   C:\STUFF> attr -a *.* +a /x:george*.* *.bat
  478.  
  479.   [Remove the archive attribute from all files in the current directory, then
  480.    set the archive attribute for all *.BAT files except for files matching
  481.    GEORGE*.*]
  482.  
  483.   C:\STUFF> xcopy *.* b:\ /a
  484.  
  485.   [XCOPY will copy all files with the archive attribute set in the current
  486.    directory to the root directory of drive B. It is that simple!]
  487.  
  488.  
  489.   Technical Support
  490.   -----------------
  491.   Technical support for ATTR and any other programs that I have written can
  492.   come to me through several sources. If you want to send me postal mail, send
  493.   your questions and comments to the following address:
  494.  
  495.     TKD Software
  496.     P.O. Box 211
  497.     Metuchen, NJ 08840
  498.  
  499.   If you have access to Internet electronic mail, send a mail message to:
  500.    tom.dyas@f331.n107.z1.fidonet.org
  501.  
  502.   If you have FidoNet netmail access, send a mail message to:
  503.    Tom Dyas at node 1:107/331
  504.  
  505.   I will try to answer your questions and improve ATTR using your comments.
  506.   Registered users will get first priority over all other people. If you want
  507.   first priority, register with me using the instructions in REGISTER.TXT!
  508.  
  509.  
  510.