Edit INI file using VBScript

Hi Guys,

The issue is I want to edit a INI file using VBScript.

There is a INI file with many sections i.e.[], I want to enter a single line at the end of a perticular section




Now I amt to add a line "This is a test script " at the end of section [Telnet3270].

End of the section can be also identify a begining of new section i.e. "["

How I can do this using a VBScript?

0 Comments   [ + ] Show comments

Answers (1)

Posted by: anonymous_9363 13 years ago
Red Belt
Check out the INI file class on JSWare.net http://www.jsware.net. It's easy to use and reliable. It'll save having to endure the mess of looping through the entire file looking for the section name string, then finding the last entry for that section, etc., etc.

Don't be put off by the scary word "class". Really, it's just a shorthand way of referring to and using a bunch of properties and functions. You just take it on to the end of your script file, declare a variable, set that variable as a 'New' object of that class, then start using its functions (more correctly, methods) and properties. There are examples.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ