home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / vrac / mtini12b.zip / README.TXT < prev    next >
Text File  |  1994-09-01  |  11KB  |  251 lines

  1. MAINTINI V1.20
  2.  
  3. Maintini is a small Utility to modify any kind of INI Files.
  4.  
  5. Usage:
  6.  
  7. Maintini uses commandfiles (Extension CMD), which contains the modifications which should be made to the INI file.
  8.  
  9. MAINTINI <INI-File> <CMD-File>
  10.  
  11. is the Syntax to call the program. If you want to modify multiple INI files, then you can create a ICM (Ini CoMmand File). This file contains on each line a INI file and a command file.
  12.  
  13. MAINTINI /c <CMD-File>
  14.  
  15. ;
  16. ; Example ICM File
  17. ;
  18. C:\WINDOWS\WIN.INI     C:\UT\WIN.CMD
  19. C:\WINDOWS\SYSTEM.INI  C:\UT\SYSTEM.CMD
  20.  
  21. A backup of the INI-File with the extension .BAK is made before modifying the file.
  22.  
  23. Normaly all section, keys and values are NOT case sensitive. However _ and * give the possibility to match only if the case matches too.
  24.  
  25. All lines which begins with ; are treated as comments.
  26.  
  27. MAINTINI can process INI-Files of any size, even larger than 64kBytes. Just the CMD File should not have to much commands, because a dynamic list with all commands is created. This is normaly not a problem, because you can use more than 100 commands in one CMD file. If this isn't enough, then you must splitt you CMD file and use a ICM file to do all changes.
  28.  
  29.  
  30. INI Commands
  31.  
  32. ;    When this is in front of a line, then this line is not used as a 
  33.     command. It is just ignored.
  34.  
  35. -[section]    The corresponding section is deleted
  36. -[section]Key                 The Key in section will be deleted
  37. -[section]Key=Value           The Key is only deleted if the Value matches exactly
  38.                               This is used to delete device=... lines in system.ini
  39.  
  40. _[section]Key=Value           Same as - but Value is case sensitive
  41.                               Normaly not used.
  42.  
  43. ~[section]Key=Value    Used to delete Keys, when the Key is terminated by a numeric
  44.     value. (Used to delete Groups in PROGMAN.INI)
  45.  
  46. #[section]                    The corresponding section is commented
  47. #[section]Key                 The Key in section will be commented
  48. #[section]Key=Value           The Key is only commented if the Value matches exactly
  49.                               This is used to comment device=... lines in system.ini
  50.  
  51. @[section]                    The ; in front of the corresponding section is removed
  52. @[section]Key                 The ; in front of the Key in section is removed
  53. @[section]Key=Value           The ; in front of the Key is removed, if the Value matches 
  54.     exactly. This is used to uncomment device=... lines in
  55.     system.ini
  56.  
  57. +[Section]Key=                Adds Key in Section.
  58. +[Section]Key=Value           Adds Key and Value to section.
  59.  
  60. &[Section]Key=Value           This Key/Value is always inserted, even if already
  61.                               a key exists, but with a different value. Used to
  62.                               insert device=... lines in System.ini
  63.  
  64. *[Section]Key=Value           Same as &, but the value is casesensitive
  65.                               Normaly not used.
  66.  
  67. ![Section]Key=Value           A key is inserted in section, but a numeric value is added to
  68.                               Key, representing the highest+1 value of Key.
  69.                               (Only ?) used for Progman.ini to add new program groups.
  70.     ~ is used to delete such keys if needed.
  71.  
  72.                               If the value of the command is already found, then the line is 
  73.     not duplicated. You can add multiple ! entrys per Section/Key
  74.     pair in one pass
  75.  
  76. >[Section]Key=Value          Adds Value to an existing value. The old Value is preserved
  77.                               and the Value is added added at the end of the line.
  78.                           
  79.     When the values are separated with a period, (like network= in 
  80.     system.ini) then you must add a period sign before the value.
  81.     Like >[386enh]networks=,vipx.386. The period sign is then
  82.     inserted when used.
  83.  
  84. /[Section]Key=Value          Same as >, but the Value is inserted in front of all existing 
  85.     values.
  86.  
  87.     When the values are separated with a period, (like network= in 
  88.     system.ini) then you must add a period sign after the value.
  89.     Like >[386enh]networks=vipx.386,. The period sign is then
  90.     inserted when used.
  91.  
  92. <[Section]Key=Value           Deletes Value from the Key/Value line. Period signs should be 
  93.     handled correctly.
  94.  
  95. r[Section]Original=NewValue    The string <Original> is replaced with <NewValue>, but only in
  96.                                 if [Section] is the current one. If you want to replace the
  97.                                 Original in ALL sections (even in the section definition) then
  98.                                 specify [] as the section. 
  99.  
  100. R[Section]Original=NewValue    Same as r command, but the case must match.
  101.  
  102. S[Section]Key=<EnvVarname>    The environment variable with name <EnvVarname> is set
  103.                                 to the Value of this Section/Key.
  104.                                 If [Section]Key does not exists, the environment is not
  105.                                 modified.
  106.                                 The modification is done in the master environment,
  107.                                 which is the one of the FIRST command.com loaded.
  108.                                 If you use this command under windows, the environment
  109.                                 of the shell inside windows is NOT modified, but when
  110.                                 you leave windows, the environment has the modified values !
  111.  
  112.  
  113. Conditional excecution
  114.  
  115. You have multiple IF commands available to excecute commandlines based on external values. You can use these commands either in the CMD file, or in the ICM file.
  116.  
  117. IFMEMBER <GroupName> <Normal commandline>
  118.     Is excecuted if User is member of the give Netware
  119.     Group. The User must be logged in the server.
  120.  
  121. IFNMEMBER <GroupName> <Normal Commandline>
  122.     As IFMEMBER, but the commandline is only excecuted
  123.     when the user is NOT member of the group
  124.  
  125. IFENV <%EnvVar%> <Value> <Normal commandline>
  126.     When the environment variable %EnvVar% is equal to
  127.     <Value>, the command is excecuted
  128.  
  129. IFNENV <%EnvVar%> <Value> <Normal commandline>
  130.     Same as IFENV, but NOT EQUAL
  131.  
  132. IFEXISTENV <EnvVar> <Normal commandline>
  133.     When the environment variable EnvVar exists, the command
  134.     is excecuted. Please note, that the name of the environment 
  135.     variable is specified without any % signs.
  136.  
  137. IFNEXISTENV <EnvVar> <Normal commandline>
  138.     Same as IFEXISTENV, but NOT EXISTS
  139.  
  140.  
  141. DOS Environment Variables
  142.  
  143. In ALL strings, you can insert a sequence %...%, to replace the text with the content of an DOS environment variable. This is true for the CMD file AND for the ICM file.
  144.  
  145. +[boot]run=F:\USER\%USER%\WINDOWS\CAL.EXE
  146.  
  147. %USER%  will be replaced with the value of the USER - Environment variable.
  148.  
  149. When It finds a single % in the line then the % remains unmodified.
  150. All %% are replaced with a single %. So you can use F:\USR\%%USER%%\TEMP to be transformed into F:\USR\%USER%\TEMP. If you simply use F:\USR\%USER%\TEMP it will
  151. try to replace %USER% with the corresponing environment variable.
  152.  
  153. You must use this, every time you have more than one % sign in the value, but don't want to replace it.
  154.  
  155. If the specified environment variable does not exist, then a warning message is displayed on the screen, and the %...% is removed from the value.
  156.  
  157.  
  158. EXAMPLES
  159.  
  160. ![Section]Key=ValueZ
  161.  
  162. [Section]    [Section]
  163. Key1=Value1    Key1=Value1
  164. Key2=Value2    Key2=Value2
  165. Key3=Value3    Key3=Value3
  166.     Key4=ValueZ
  167.  
  168. >[Section]Key=Value1
  169.  
  170. [Section]    [Section]
  171. Key=Value0    Key=Value0 Value1
  172.  
  173. >[Section]Key=,Value1
  174.  
  175. [Section]    [Section]
  176. Key=Value0    Key=Value0,Value1
  177.  
  178. /[Section]Key=Value1,
  179.  
  180. [Section]    [Section]
  181. Key=Value0    Key=Value1,Value0
  182.  
  183. <[Section]Key=Value1
  184.  
  185. [Section]    [Section]
  186. Key=Value0,Value1    Key=Value0
  187.  
  188. IFMEMBER MANAGER ![Groups]Group=LAFW.GRP
  189.  
  190. Adds GroupXX=LAFW.GRP only if the user is member of the group MANAGER
  191.  
  192. IFENV %USER% SSCA +[Windows]Supervisor=True
  193.  
  194. Sets Supervisor=True, when the environment variable USER is equal to SSCA
  195.  
  196. +[boot]run=F:\USER\%USER%\WINDOWS\CAL.EXE
  197.  
  198. %USER%  will be replaced with the value of the USER - Environment variable.
  199.  
  200. +[boot]run=F:\USER\%%USER%%\WINDOWS\CAL.EXE
  201.  
  202. gives run=F:\USER\%USER%\WINDOWS\CAL.EXE
  203.  
  204. r[][OldSectionName]=[NewSectionName]
  205.  
  206. This command renames a section heading. Maintini then looks in each line for the Old-name and if it finds it, it replaces it with the new name. You should include the [..] to be shure, that only section headings are replaced.
  207.  
  208. %INICommand%
  209.  
  210. With this command, the complete command is read from the environment variable INICommand. So when INICommand is equal to +[S]X=Y then this command is excecuted.
  211. You can use this feature in the ICM files too, not only in the CMD files.
  212.  
  213.  
  214. Take care when... 
  215.  
  216. - Modifying device= lines in the SYSTEM.INI file. Since this is the only place where multiple keys exists, who have the same name. To handle this special situation, you MUST use the & command instead of the + command. When you try to do modifications with the + command, then either all device= lines have the same value, or/and some keys are added multiple times.
  217.  
  218. - With the r command it is very easy to move a program/library to a new loaction. Of course you must take care to correct all other references to that location. (In the registeration database OLE, in DDE-statements and of course the program icon(s) in the program manager.)
  219.  
  220. Known Problems
  221.  
  222. - If your DOS environment is full, then it is possible that maintini crashes the workstation. I haven't found the problem, so I can't do anything against this. So if you excpect such problems, then create a greater environment.
  223.  
  224. - When using the S command to set environment variables, then be aware of the following. The modification is done in the master environment, which is the one of the FIRST command.com loaded. If you use this command under windows, the environment
  225. of the shell inside windows is NOT modified, but when you leave windows, the environment has the modified values !!! When I find a TP library which handles this correctly, I will implement it, that the parent environment is changed. (Perhaps you have an idea where to find such a library ???)
  226.  
  227. - No other Problems are known for this release V1.20
  228.  
  229. Licence Agreement
  230.  
  231. MAINTINI is emailware, which means if you find this program usefull, you should send me a email. (Or a nice postcard if you don't have acess to a email system)
  232.  
  233. If you send me a message, then I will inform you of future versions of this utility.
  234.  
  235.  
  236. My email adress:
  237.  
  238. Compuserve   :  100034,3536 Andre Schild
  239. Internet     :  100034.3536@compuserve.com
  240. AT&T Mail    :  mhs!csmail!100034.3536
  241. X400         :  /c=US/ad=compuserve/pd=csmail/d.id=100034.3536
  242. MCI          :  TO: Andre Schild   
  243.                 EMS: COMPUSERVE/ MCI ID:281-6320
  244.                 MBX: 100034,3536
  245. MHS          :  MAIL@CSERVE {100034,3536}
  246.  
  247. Postal adress:  Andre Schild
  248.                 Pfeidstrasse 8
  249.                 CH-2555 Bruegg b. Biel
  250.                 Switzerland
  251.