ahmetpi Posted December 20, 2020 Share Posted December 20, 2020 (edited) Hi How can i delete a section in ini file? I want to delete the section itself, not the keys and values in the section. If I use inidelete, the name of the section remains in the ini file. Example: ini file: [EXAMPLE] key1=value1 key2=value2 If i use ini delete; [EXAMPLE] So, how can i remove this section name from ini file? Thanks Edited December 20, 2020 by ahmetpi Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 20, 2020 Moderators Share Posted December 20, 2020 How about posting your script to show us what you're doing? IniDelete will, if you do not specify a key, delete the entire section. The example code below creates 5 sections, and then deletes the third. For $a = 1 To 5 IniWrite(@DesktopDir & "\my.ini", "NewSection" & $a, "MyKey", "Val") Next Sleep(1000) IniDelete(@DesktopDir & "\my.ini", "NewSection3") ahmetpi 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
ahmetpi Posted December 20, 2020 Author Share Posted December 20, 2020 18 minutes ago, JLogan3o13 said: How about posting your script to show us what you're doing? IniDelete will, if you do not specify a key, delete the entire section. The example code below creates 5 sections, and then deletes the third. For $a = 1 To 5 IniWrite(@DesktopDir & "\my.ini", "NewSection" & $a, "MyKey", "Val") Next Sleep(1000) IniDelete(@DesktopDir & "\my.ini", "NewSection3") I made a mistake while writing the code Problem is solved, thanks for helping Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now