|Table Of Contents||Index|
IniTyme is a Windows *.INI file manipulator. It is designed to assist the network administrator who has to maintain INI files for many users.
USAGE: INITYME ChangeFile IniFile [/Q]
or MARXMENU INITYME ChangeFile IniFileNote: If you are running IniTyme from MarxMenu rather that INITYME.EXE, then all references to running INITYME are really MARXMENU INITYME.
The /Q switch puts IniTyme in Quiet mode. No messages to the screen are displayed.
INITYME CHANGE.INI SYSTEM.INIIn the above example CHANGE.INI is the control file that will control the changes that will be written to the target file SYSTEM.INI. You can also invoke IniTyme by passing only one parameter. If you pass only one parameter, then the extension DEF or CTL are assumed for the name of the change file.
INITYME SYSTEM.INI (SYSTEM.DEF or SYSTEM.CTL are assumed)The ChangeFile is formatted like an INI file. A sample changefile might look like this:
; CHANGE.INI : A sample changefile for the IniTyme Program.Any line that starts with the semicolon is a comment and will not be processed.
subst 'C:\WINDOWS\PM4\' 'W:\PM4'
[boot] del sound.drv ;deletes a line
del [keyboard] ;deletes a section
[386Enh] Paging=1 Device=mydev.386 foo=bar ADD TestMode=3 CHANGE mydevice=mydriver.386
[fonts] subst 'V:\' 'P:\WINDOWS\'
Adding and updating lines is done by listing the new lines as you wish them to appear. In the example there is a line in the [386ENH] group that reads PAGING=1. If the target INI files does not contain a [386ENH] group it will be created. The default mode is - change it if it's there, add it if it's not.
If that group does not contain a PAGING=1 line it will be added to the group. If a line in the [386ENH] group already exists that sets PAGING=2 it will be changed to PAGING=1. The word DEVICE= is a special case if it is found in the [386Enh] section and it is automatically added unless the whole line matches something that's already there.
Using the word ADD in front of the line causes the line to be added if it isn't already there, but not changed if it is already there. (Add but don't change.)
Using the word CHANGE in front of the line causes the line to be changed if it is there, but not added if it isn't there. (Change but don't add.)
Using the word DEL in front of the line causes a matching line to be deleted from the INI file. The DEL command can also be used to remove entire groups as illustrated in the example line DEL [KEYBOARD].
When using commands like Run=Prog1 Prog2 Prog3 you might want to add more items to the list. If you change file contains: "AddItem Run=Prog4 Prog5" then the result will be "Run=Prog1 Prog2 Prog3 Prog4 Prog5"
Similar to AddItem, DelItem removes items form a list. If your INI file contains "Run=Prog1 Prog2 Prog3 Prog4" and your change INI file contains "DelItem Run=Prog2 Prog4" then the result will be: "Run=Prog1 Prog3"
ADDITEMCOMMA DELITEMCOMMA -------------------------
Same as AddItem and DelItem except the items are separated by a comma and a space.
WRITE / WRITELN ---------------
Write writes a message to the screen. It can be used as a tool for debugging change files. Writeln writes the line with a carriage return and linefeed. Write does not.
Example:ADDVALUE -------- If a line is found, AddValue will add (or subtract for negative values) the amount of the line in the change file.
Writeln 'Made it Here!' Writeln 5 + 3 ' ' ReadEnv 'temp'
Original file has: NumValue=9 Change file has: AddValue NumValue=3 Result file will have: NumValue=12
If you use the command AFTER <line> then the next item that is added or changed will be put after the line you specified. If the line you specified isn't found then it is added to the end of the section. The after command can also be used to move a line from one place to another within the same section.
Example:BEFORE ------ Before is just like after except it adds the line before the specified line.
After Run Foo=Bar
If you use the word first, then the next item added will be first in the section.
The SUBST command is used to replace strings within an INI file. It can be used in two fashions either globally throughout the file or locally within a group. In the above example it is used both ways.
Putting the line SUBST 'C:\WINDOWS\PM4\' 'W:\PM4' before the first group header will cause the path string 'C:\WINDOWS\PM4\' to be globally replaced throughout the file with 'W:\PM4'. In the last line of the above example the SUBST 'V:\' 'P:\WINDOWS\' command will replace only those strings that match in the group [fonts].
The SUBST command also supports references to environment variables. Thus F:\HOME\%USER%\WINDOWS becomes F:\HOME\MARC\WINDOWS.
INITYME also has special provisions for handling the [GROUPS] section on the PROGMAN.INI. This section numbers the groups that are referenced. INITYME will scan the groups listed and determine the first available group number when it is adding to the [GROUPS] group.
To illustrate, if the PROGMAN.INI files group section reads as follows:
[Groups] Group1=H:\WINDOWS\MAIN.GRP Group2=H:\WINDOWS\ACCESSOR.GRP Group4=H:\WINDOWS\STARTUP.GRP Group5=H:\WINDOWS\BP7.GRP Group6=H:\WINDOWS\ALDUS.GRP Group7=F:\HOME\MARC\WINDOWS\WORDFORW.GRP Group8=F:\HOME\MARC\WINDOWS\MICROSOF.GRP Group3=F:\HOME\MARC\WINDOWS\EDOS.GRPand your ChangeFile contains:
[Groups] DEL group=BP7.GRP Group=MAIN.GRP Group=MYGROUP.GRP DEL group=EDOS.GRP Group=Z:\SYSTEM\TEST.GRP Group=MASTER.GRPAfter executing IniTyme your PROGMAN.INI group section would now read:
[Groups] Group1=MAIN.GRP Group2=H:\WINDOWS\ACCESSOR.GRP Group4=H:\WINDOWS\STARTUP.GRP Group6=H:\WINDOWS\ALDUS.GRP Group7=F:\HOME\MARC\WINDOWS\WORDFORW.GRP Group8=F:\HOME\MARC\WINDOWS\MICROSOF.GRP Group5=MYGROUP.GRP Group3=Z:\SYSTEM\TEST.GRP Group9=MASTER.GRPIf new groups are added, the Order= line in the [Settings] section is updated.
DUPLICATES ---------- Most key words in INI files are unique, with the notable exception of the Device= keyword in the [386enh] section. IniTyme allows you to specify other keywords that are allowed to be duplicated. Duplicates are specified at the top of the file before any sections are defined.
Example:You can also specify duplicates for all sections by specifying the section name [*].
Duplicates Device=[386enh] ;default Duplicates Dups=[Section]
Example:CLEANNOEQUALS ------------- The CleanNoEquals command tells IniTyme to remove lines that do not cantain an = sign. This is used to automatically clean up damaged INI files.
CLEANEMPTYSECTIONS ------------------ The CleanEmptySections command is used to remove sections that contain no lines.
IniTyme supports conditional changes. If the condition is met then the changes are made. If statements can be nested.
if [condition] Device=mydev.386 add foo=bar else Device=otherdev.386 change foo=notbar endifCONDITIONAL LIBRARY -------------------
And Returns the logical And of two values.
Example:Or Returns the logical Or of two values.
if InGroup 'EveryOne' and InGroup 'Accounting'
Example:Xor Returns the logical Xor of two values.
if InGroup 'EveryOne' or InGroup 'Accounting'
Example:Not Returns the logical Not of a value.
if InGroup 'EveryOne' Xor InGroup 'Accounting'
Example:+ Adds two values.
if Not InGroup 'EveryOne'
Example:- Subtracts two values.
if 'A' + 'B' = 'AB'
Example:= Compares two values and returns true if they are equal.
if 5 - 3 < 4
Example:<> Compares two values and returns true if they are not equal.
if 2 + 2 = 4
Example:> Compares two values and returns true if the first value is greater than the second value.
if 2 + 2 <> 5
Example:< Compares two values and returns true if the first value is less than the second value.
if 'D' > 'C'
Example:>= Compares two values and returns true if the first value is greater than or equal to the second value.
if 'C' < 'D'
Example:<= Compares two values and returns true if the first value is less than or equal to the second value.
if 'D' >= 'C'
Example:( ) Parens begin and end logical grouping for interpretation.
if 'C' <= 'D'
Example:True Returns the logical value True
if ('A' < 'B') and (9 > (5 + 3))
Example:False Returns the logical value False
Example:ReadEnv (Environment String) Returns the value of an environment variable.
if not False
Example:ValueOf Return the value of an element in the current section.
if ReadEnv 'ENHANCED' = 'Y'
Example:Value (String) Return the numeric value of a string.
if ValueOf 'PagingDrive' <> 'H' PagingDrive=C endif
Example:UpperCase Returns the UpperCase of a string.
if Value(ValueOf CachedFileHandles) < 12 CachedFileHandles=20 endif
Example:CPU Returns the class of CPU chip you are running.
if UpperCase ReadEnv 'ENHANCED' = 'Y'
Example:MathChip Returns true if you have a math coprocessor.
if CPU >= 3
Example:Display Returns the type of video card. Types returned are HERC, CGA, EGA, VGA.
Example:InGroup (Group) Returns True if user is in the Novell group.
if Display = 'VGA'
Example:If you are not running on Novell, you can set an environment variable and list the groups there.
if InGroup 'EveryOne'
InMem (TSR) Returns True if the TSR is in memory. It can also detect the names of pending batch files that are running.
Example:ExistFile (Name) Returns True if the file exists.
if InMem 'IPXODI' if InMem 'AUTOEXEC'
Example:ExistDir (Name) Returns True if the directory exists.
if ExistFile 'C:\WINDOWS\SOL.EXE'
Example:ShellLoaded Returns True if the Novell VLM or NetX shell is loaded.
if ExistDir 'C:\WINDOWS'
Example:VlmLoaded Returns True if the Novell VLM shell is loaded.
Example:Station Returns the workstation address on a Novell network or the value set in the environment variable STATION=.
Example:UserName Returns the Novell login name of the user, or the value set in the environment variable USER=.
if Station = '250:33333'
Example:DayOfWeek Returns the first three letters of the day of the week.
if UserName = 'Marc'
Example:Month Returns the first three letters of the Month.
if DayOfWeek = 'TUE'
Example:INIMAN COMPATIBILITY -------------------- In order to make IniTyme more compatible with the popular IniMan program from Saber Software, (which is now McAfee) I've added several new conditionals and some syntax enhancements. Because of differences in the design of these two programs, IniTyme is not 100% compatible with IniMan's DEF files. But, these additions are a step in that direction, and makes the transition significantly easier.
if Month = 'AUG'
IniTyme will search for DEF files in the current directory and the directory pointed to by the S_CONFIG environment variable.
Unlike IniTyme, IniMan uses ";*" as a keyword for it's conditionals. IniTyme supports ;* for compatibility, but when given the choice, IniTyme's more powerful IF should be used. The ;* works like the word IF, but it uses the rules of IniMan instead. IniMan's ;* and IniTyme's IF statements can be freely mixed. IF statements can be nested.
IniMan conditionals can be easilly converted to IniTyme conditionals as follows:
if Groups=Everyone Line1=1 endifIniMan:
;*Groups=Everyone ;*begin Line1=1 Line2=2 ;*endIniTyme:
if Groups=Everyone Line1=1 Line2=2 endifOne difference between IniMan and IniTyme is if the conditional is not true, IniMan will delete the line. Inityme will do nothing to the line unless you specify it specifically in an else statement. Since IniTyme has the DEL command, you get more specific control over what you can do. If you want a line to be deleted if the condition is not met, you would do as follows:
if Groups=Everyone Line1=1 else Del Line1= endifAnother difference between IniMan and IniTyme is that IniMan will not change a line if it already exists. IniTyme will change the line. If you want a command to behave like IniMan, do this:
Add Line1=1The word ADD tells IniTyme to add the line if it doesn't exist, but not to change it if it does.
IniMan conditionals don't require quotes around strings, so quotes can be used optionally.
If multiple conditions are specified without the use of AND, OR, or XOR; then AND is assumed.
Example:In the above example, the condition is True only if both conditions are met. If you want it to be True if either condition is met, then you will do the following:
Example:IniTyme also supports the IniMan Not symbol "!". If "!" is placed in front of a member of the list, it means "and not this". The following example means if the user is in groups Accounting or Sales and the user isn't Marc.
;*Groups=Accounting,Sales or Users=Marc,Grace
Example:Unlike IniMan, the not symbol can be mixed freely.
if Groups=Accounting,Sales Users=!Marc
Example:IniMan conditionals can be freely mixed with IniTyme conditionals. Inityme supports using IF instead of ;*. The following two statements are the same:
;*Groups=Accounting,Payroll and (DayOfWeek = 'FRI') if Groups=Accounting,Payroll and (DayOfWeek = 'FRI')IniTyme does not support IniMan REV statements because they are not necessary in IniTyme. IniMan required REV statements in order to change lines in the INI file to a new value. IniTyme does this by default.
Shell=SMENU.EXEINIMAN CONDITIONALS -------------------
Groups=Group1,Group2,Group3 Returns true if the user is a member of any of the listed groups.
Example:Users=User1,User2,User3 Returns true if the user is one of the listed users.
Example:Hardware=VGA Returns true if one of the listed hardware pieces is present.
Example:Stations=Station1,Station2,Station3 Returns true if the station is one of the listed stations. The comparison is based on partial string compares so that you could match a range of station numbers.
Example:Network= Returns true if user is on the specified network.
Example:File=File1,File2,File3 Returns true if any listed files exists.
Example:Dir=Dir1,Dir2,Dir3 Returns true if any listed directories exists.
Whenever INITYME runs it creates a backup of the original file with a *.BNI extension. If you decide you don't like the changes you've made you can execute a one generation restore with the command:
INITYME RESTORE SYSTEM.INIThis will delete the current SYSTEM.INI file and rename the SYSTEM.BNI file to SYSTEM.INI. If a matching BNI file is not present then the restore command does not do anything.
If by chance you are in a situation where murphy has tried to make your day really bad and you've screwed up your INI files royally, be sure to remember the SALVAGE command from netware. But nothing, not even salvage, is an acceptable substitute for a current set of backups. One suggestion might be to use PKZIP to ZIP up a set of your pre-modified INI files. This gives you the opportunity to play without risk. Nothing beats backups!
BACKUP NAME -----------
By default, the backup extension for INI files is BNI. Hoewever, if you want to change this, use can use the BackupName command in the change file as follows:
Example:If you want to change only the extension of the backups, then start the BackupName with '*.' as follows:
The NoBackup command is used if you don't want to create the BNI backup file. This will save disk space, however, you lose the safety of having the ability to undo what you just did. The BNI file is actually created and then deleted, so if you have Novell's salvage of and UnDelete command you can get the BNI file back.
PIPING FILENAMES ----------------
IniTyme can be used to update many INI file in bulk by creating a ListFile contains a list of INI files. Then simply provide IniTyme with the filename of the list file instead of a specific INI file. The syntax of a list file should be something like:
\home\phil\windows\system.ini \home\marc\windows\system.ini ...etc...You can also pipe a list of files to IniTyme as follows:
WHEREIS SYSTEM.INI|INITYME CHANGE.INIFile name references in INITYME can include references to environment variables. Thus \HOME\%USER%\WINDOWS\SYSTEM.INI is a valid filename if the environment variable USER is set.
LOGGING CHANGES ---------------
If you want to create a log file of the changes that were made to the file add the command:
LOG [FileName]in your CHANGE.INI file, before the first section header, and INITYME will log the changes in the FileName you specify. If the FileName isn't specified the default name is your INI file name with a LOG extension.
If you want the log to append to and existing log file, use the command:
APPENDLOG [FileName]YAK MODE -------- If Yak is on, all changes will be displayed on the screen. To turn Yak on, add a line with the word "Yak" before the first section.
TEST MODE ---------
If you want to test a change file without changing the original INI file then add the word TestMode to the CHANGE.INI file before the first section header. In test mode the changes are written to the BNI file and the INI file is left untouched. You can then look at the BNI file to see the changes.
|Table Of Contents||Index|