PDA

View Full Version : In INI files, how to obtain value of a key when part of a Section is unknown?


chian
01-25-2001, 11:33 PM
Below is part of an INI file located under %AppDir%. The number "1920" is assigned randomly by the installation program and is unique to each workstation. Is there a way to read what the actual Key is? In my case it is "1920" under [MACHINE ID]. The value of the Key varies.
If I can get a variable (%MyVar%) assigned with 1920, can I use it to access a Key under [ID 1920] by maybe using [ID %MyVar%]?
In the end, what I need is to read/modify the Key BuildID.

-------------------------------------
[MACHINE ID]
1920=user

[ID 1920]
installdate=01/26/2001 12:05:47 AM
updatedate=01/26/2001 12:05:47 AM
buildID=0025
-------------------------------------

Thanks,
Carlos

Mark
01-26-2001, 02:09 PM
Hi,
Sorry but getting the key value really is not possible using Visual Patch. The only thing I could suggest doing is using the Windows API to enumerate all the KEYS in a SECTION. This would have to be accomplished by running an external program that you design.

mark.

[This message has been edited by Mark (edited 02-13-2001).]