Re: How to read and write INI file, or access windows API functions?

Tech-Archive recommends: Speed Up your PC by fixing your registry



You can read INIs with basic Textstream operations.
They're just text files. Or see here for an INI class:

http://www.jsware.net/jsware/scripts.php3#classpk

There is one small catch, though: The system does not
immediately recognize INI updates (in case you're editing
system INIs). With API you can "flush" the update if necessary,
but VBS can't realistically use the API. (...Stand by for
mr. unreliable's addendum to that staement. :)

Is that possible to call windows API functions by using VBScript?
I am trying to read an INI file from VBScript through CScript window 2000
host.

Thanks
Michael







.



Relevant Pages

  • Re: Reg/INI Discussion from much earlier
    ... (File I/O and System Pooled Memory) so it is hard to see ... > I suspect that they are very inefficient, and prefer to use my own INI ... The API calls do have an advantage when it comes to writes, ... > I should really do a similar test with FileMon ...
    (microsoft.public.vb.general.discussion)
  • Re: Saving and restoring windows
    ... Why bother cluttering up the OS2.INI with that junk? ... Never found or used that API myself. ... If you can't select an INI handle, then it seems kinda useless to me. ...
    (comp.os.os2.programmer.misc)
  • Re: Looking for some advice for my program
    ... completely forgotten that you use API calls to deal with them. ... I can only think that the API is for dealing with the 'order' of ... INI ... The API provides a way to say, "Give me entry X from section Y" or "Save Z ...
    (microsoft.public.vb.general.discussion)
  • Re: Some users cant write to ini file.
    ... application that reads the .ini through the API. ... Also, try changing the .ini by running the app., close the app., open ... the .ini in Notepad - you may well see the .ini as it was before the ...
    (borland.public.delphi.language.objectpascal)
  • Re: Edit/Delete section of an ini file
    ... and it also makes sense because at load time the INI ... I have found a couple of googles that state "The following entries are the ... via API, but were created by the install program with those values for, as you ... access by programs/OS utilities that read the file in a NON API ...
    (microsoft.public.scripting.vbscript)