Infos on SHOWINI.CMD ==================== 1) Working interactively with OS/2-INI-files ============================================ SHOWINI.CMD allows you to interactively a) view b) print to text-(ASCII)-file c) edit d) move/copy e) delete Toplevel entries ("Application entries") and key-entries in OS/2-INI-files. Just enter: showini Initially you will **not** see the menu choices for editing, moving/copying and deleting INI-entries for safety reasons. Also, you will get a choice to work with OS2.INI (USER) and OS2SYS.INI (SYSTEM). With "s" for scan you can have SHOWINI.CMD to automatically scan for valid OS/2-INI-files on all local and/or remote drives or a specific drive, it will successfully ignore Winodows-INI-files. Once you configure one of the above manipulative functions the configuration choice will be shown, if you reset them, it will not be shown anymore. Therefore you could safely leave this program on a machine for end-users. In order to activate the edit, move/copy and/or delete functions, you need to enter "c" (configure) on the main menu. This option will allways be accessible from the INI- and TopLevel-menus, no matter whether it is displayed or not. All these settings will be stored in OS2.INI under the TopLevel-entry called "RGF Showini.cmd". Hint: If there are many entries in an INI-file, use the MODE-command to get more lines or more columns and/or lines: e.g. "MODE co80,100" for 100 lines or "MODE co132,50" for 132 columns and 50 lines on an XGA-adapter Hint: Wherever it is possible from the program logic, you may immeditiately end SHOWINI.CMD by typing "q" (quit). Attention: if quitting the program, changes to the settings are not stored in OS2.INI. 2) Batchfile-commands ===================== SHOWINI.CMD allows for backing up and ***restoring*** INI-files while the system is running ! This means that you can backup even OS2.INI and OS2SYS.INI while the system is up and restore them from a backup while the system is running. SHOWINI.CMD automatically produces **10-generation** backups. a) BACKUP ========= syntax: showini /B INI-file showini /BT INI-file This will produce a backup-file, which is **allways** located in the drive and subdirectory of the given INI-file. If you do not give a drive and a path, SHOWINI.CMD assumes that your INI-file is located in the current drive and path. By default SHOWINI.CMD produces 10 generations of backup, thereafter deleting the oldest to make room for the new backup. Depending on the switch, /B or /BT, the backup file will be an OS/2-INI-file or a plain text-(ASCII)-file. Backups in the OS/2-INI-file format will have a filename which corresponds to the original file-name where the last letter will be replaced by the digits 0 thru 9, e.g. OS2.IN0, OS2.IN1, OS2.IN2, ..., OS2.IN9. Backups in the text-(ASCII)-file format will get a file-extension of TX0, TX1, TX2, .., TX9. examples: showini /b c:\os2\os2.ini ... make a backup, the resulting backup will be of type OS/2-INI, and will get a name of "c:\os2\os2.in0", ..., "c:\os2\os2.in9"; generations are counted from 0 to 9; subsequent backups will cause the backup numbered with 0 to be deleted, all others backups being renamed by subtracting one from their number, such that the backup to be generated will safely get the number 9 assigned. showini /bt os2sys.ini ... make a backup of the OS/2-INI-file called "os2sys.ini" located in the actual drive and path, the resulting backup will be of type TEXT (ASCII), and will get a name of "d:\os2\os2sys.tx0", ..., "d:\os2\os2sys.tx9", **if** the present drive and path is "D:\OS2"; generations are counted from 0 to 9; subsequent backups will cause the backup numbered with 0 to be deleted, all others backups being renamed by subtracting one from their number, such that the backup to be generated will safely get the number 9 assigned. b) RESTORE ========== syntax: showini /R backup-file showini /RT backup-file This will restore an OS/2-INI-file from the given backup-file, which is **allways** located in the drive and subdirectory of the INI-file to be restored. Depending on the switch, /R or /RT, the backup file will be an OS/2-INI-file or a plain text-(ASCII)-file. SHOWINI.CMD will use the filename information stored in the backup-file (in the case of an OS/2-INI-type backup, the original filename is stored in the TopLevel-entry "RGF Showini.cmd"), ***but*** will ignore the stored drive and path information, instead it will use the drive and path (for security reasons) given in the command-line (i.e. "backup-file") !!! If the text-backup-file (ASCII-file) contains blank lines or ones having a semicolon (;) as the first character, they will be ignored. ***Attention*** In the restore-mode all keys not being in the backup-file but existing in the INI-file will be ***deleted*** from the OS/2-INI-file, thereby producing an exact copy of the backup ! If you do not want this behavior use the update-mode, which just updates the TopLevels and Keys found in the backup-file. Hint: If you want to delete numerous keys or TopLevels, then make a text-backup (switch "/BT") and either delete or remark those lines with the appropriate entries and run a restore-operation (using any editor like EPM, which is my preferred one). examples: showini /r d:\apps\mamamia.in9 ... restore the OS/2-INI-file located in "D:\APPS", get the name of it from the backup "mamamia.in9", if not found, then assume that the INI-file is called "MAMAMIA.INI"; restore the INI-file from the backup, delete all TopLevels and keys in target which are not found in the backup. The backup is a true OS/2-INI-file and could therefore also be copied over the original OS/2-INI-file. Note: drive and path information stored in the backup are ignored for security reasons. showini /rt papatuo.tx0 ... restore the OS/2-INI-file located in the actual drive and subdirectory, get the name of it from the backup "papatuo.tx0". Restore the INI-file from the backup, delete all TopLevels and keys in target which are not found in the backup. The backup is a TXT-(ASCII)-file. Note: drive and path information stored in the backup are ignored for security reasons. c) UPDATE ========= syntax: showini /U backup-file showini /UT backup-file This will update an OS/2-INI-file with the information from the given backup-file, which is **allways** located in the drive and subdirectory of the INI-file to be restored. Depending on the switch, /U or /UT, the backup file will be an OS/2-INI-file or a plain text-(ASCII)-file. SHOWINI.CMD will use the filename information stored in the backup-file (in the case of an OS/2-INI-type backup, the original filename is stored in the TopLevel-entry "RGF Showini.cmd"), ***but*** will ignore the stored drive and path information, instead it will use the drive and path (for security reasons) given in the command-line (i.e. "backup-file") !!! If the text-backup-file (ASCII-file) contains blank lines or ones having a semicolon (;) as the first character, they will be ignored. examples: showini /u g:\aha\ok\epm.in3 ... restore the OS/2-INI-file located in "G:\AHA\OK", get the name of it from the backup "epm.in3", if not found, then assume that the INI-file is called "EPM.INI"; restore the INI-file from the backup. In contrast to the restore mode, superfluous TopLevels and keys in the target are ***not*** deleted! The backup is a true OS/2-INI-file and could therefore also be copied over the original OS/2-INI-file. Note: drive and path information stored in the backup are ignored for security reasons. showini /ut klondike.tx9 ... restore the OS/2-INI-file located in the actual drive and subdirectory, get the name of it from the backup "klondike.tx9", if not found, then assume that the INI-file is called "KLONDIKE.INI"; restore the INI-file from the backup, delete all TopLevels and keys in target which are not found in the backup. The backup is a TXT-(ASCII)-file. Note: drive and path information stored in the backup are ignored for security reasons. 3) EXIT-codes ============= 0 ... everything went o.k. -1 ... user aborted program -2 ... wrong switch or invalid filename -3 ... invalid backup-file 4) minimal layout of text-(ASCII)-backup-files ============================================== ; a line starting with a semi-column is a comment and is ignored ; blank lines are ignored as well ; the file entry must be included and be given before the TopLevel- and ; key-entries; it may span multiple lines (for long filenames) and has ; the principal layout ; ; "File [file name]" ; delimiter for the value is allways an opening and ending square ; bracket File [D:\work\klondike.ini] ; A TopLevel (application) entry starts with the keyword "Top"; is being ; followed by the datatype [A], [A0] or [H] for ASCII, ASCII-Z, resp. ; hexadecimal; the last entry is the value enclosed in square brackets. ; ; The same syntax applies to the key-names ("Key") and finally to the ; values themselves ("Val"). ; ; Any Value for TopLevel-names, Key-names and Key-values may span ; multiple lines; if so, subsequent lines must not contain a key-word, ; but the data-type and the value. Top [A] [PATIENCE] Key [A] [CardBack] ; the key-value is of ASCII-string, terminated by \0; note that the ; terminating '00'x is not contained within the value part: Val [A0] [2] ; the following key-value spans two lines: Key [A] [ColorSet] Val [A0] [13] [A0] [03] ; this is an example for hexadecimal values for all three, ;TopLevel-name, key-name and key-value: Top [H] [01020304050607] Key [H] [08091011] Val [H] [12131415] ; note values enclosed in the square-bracket-delimiters may contain ; square brackets themselves: Top [A] [This is another TopLevel-entry [yes, another]] Key [A] [This is another key-entry] Val [A] [This is a plain ASCII-entry.] Key [A] [This is the second key-entry, within this TopLevel.] Val [A0] [This is an ASCII-Z entry.] For further examples of the syntax of the text-(ASCII)-file see any printout or text-(ASCII)-backup. CONCLUDING remarks ================== Be patiened if you are running SHOWINI.CMD in batch-mode. All update- and insert-operations on OS/2-INI-files are ***extremely*** slow ! Hopefully this behaviour will be improved in a later release (actual release level OS/2 2.00). Rony G. Flatscher, Vienna/Austria/Europe, Wirtschaftsuniversitaet Wien 1992-06-01