    --------------------------------------------------------------------
    INIFILE Write and Read             Ver 1.1 (c) 2002, Horst Schaeffer
    --------------------------------------------------------------------

    This DOS program handles Windows type INI files with section names
    in square brackets, and assignments of the form: item=string
    (case ignored for section and item names), for example:

        [Desktop]
        Wallpaper=C:\WINDOWS\GBLUE.BMP
        TileWallpaper=1

    Not supported in this version:

    -   multiple items with same name in same section (only the first
        occurrence will be found)
    -   handling of multiple (comma separated) assignments for an item
        (only the complete string is read or written)


    Change or add an assignment
    ---------------------------

    Syntax:  INIFILE inifile_name [section] item=string

    Example: INIFILE %windir%\win.ini [Desktop] TileWallpaper=1

    Notes:

        The string is taken up to the end of the line, trailing spaces
        truncated.
        Optionally, the (complete) assignment may be enclosed in quote
        marks (in case there are redirection symbols in it).
        Example:
             INIFILE %windir%\win.ini [Desktop] "TileWallpaper=1"

        If the item exists, the complete line will be replaced.
        If the item is not found, a new line will be added.
        If the section is not found it will be added.
        If the INI file is not found, it will be created.


    Remove assignment
    -----------------

    To remove an item: omit the string (the equal sign is mandatory)

    Syntax:  INIFILE inifile_name [section] item=

    Example: INIFILE %windir%\win.ini [Desktop] Pattern=

    Notes:
        The complete item (not just the string) is removed.
        The section will also be removed, if there are no items left.


    Read an assignment
    ------------------

    Syntax:  INIFILE inifile_name [section] item

    (Note that an additional equal sign would remove the item!)

    The program will generate a SET statement, and send it to STDOUT.
    If you want to produce an environmental variable, redirect the
    output to a temporary batch file, and execute it.

    Example: INIFILE %windir%\win.ini [Desktop] Wallpaper > temp.bat
             call temp.bat

    Contents of temp.bat will be (for example):

             set Wallpaper=C:\WINDOWS\GBLUE.BMP

    If the assignment could not be found for any reason,
    the SET statement will clear the variable, e.g.:

             set Wallpaper=


    Special: No-Section Mode
    ------------------------
    If you have an INI file without any sections, you must specify an
    empty section in the command, e.g.:

        inifile MY.INI [] entry=something

    In case you use this on an INI file WITH sections, the command
    refers to assignments BEFORE the first occurrence of a section
    name in square brackets (if there are any such assignments..)



    Handling spaces
    ---------------

    General:
        Section and item names may include blank space.

    In INI file:
        Leading spaces at the beginning of lines are ignored.
        Spaces between item name and equal sign are ignored.

    In the command line:
        Any blank spaces before or after the equal sign are removed.
        Trailing spaces are removed.
        This also applies when the assignment is put in quote marks!


    Errorlevels
    -----------

    Errorlevel > 0 indicates an error (message to STDERR)
    Causes: syntax error, or file operations failed, or file too large.


    Case conversion
    ---------------

    Upper/lower case conversion for non-standard ASCII characters
    is done according to codepage 437. For other codepages see file
    CASE103.PAT


    Limitations
    -----------

    Maximum file size:            60 Kb
    Maximum line size in command: 1 Kb  (item name + string)
    Maximum section name size:    50 bytes

    Only DOS file names (8.3) are supported, and the path (incl. file
    name) must not be longer than 63 bytes.


    Disclaimer, Copyright
    ---------------------
    This program is distributed as "freeware", copyright reserved by the
    author. There are no warranties of any kind, nor any liability by
    the author. Users accept full responsibility for the use they make
    of the software and for any damage caused thereby.

    Contact the author:

    Email      horst.schaeffer@gmx.net

    Homepage:  http://home.mnet-online.de/horst.muc/


*** 17 NOV 2002
