The Microsoft Patterns and Practices Enterprise Library has a configuration
console that does this and a lot more. If you download the library you get
all the source code as well (in c#). It's obviously tailored for use with
the different Enterprise Application Blocks but the principle should be
similar. http://www.microsoft.com/practices and look for link to "Enterprise
Library for .NET Framework 2.0" under downloads.