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
e.g.
INIfile
[Test]
hasbcb
jhbc
[Telnet3270]
sjhgfj
[Menu]
mnbf
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?
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
e.g.
INIfile
[Test]
hasbcb
jhbc
[Telnet3270]
sjhgfj
[Menu]
mnbf
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)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
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.
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.
so that the conversation will remain readable.