This works really well and is very handy to steer clear of the registry.
The filename "settings.ini" needs to be "\settings.ini" otherwise if you run it from c:\somedir it will create a file called somedirsettings.ini in the C drive rather than the desired c:\somedir\settings.ini