Because my N900 automatically adds any wireless network it connects to into its list of connections and tries to reconnect whenever it sees them, I need to find a way to remove connections, preferably automatically rather than having to go into Settings.
I've traced the configuration files to /var/lib/gconf/system/osso/connectivity/IAP, where a new subdirectory is created for each connection. Logically, removing the subdirectory from there should get rid of the unwanted connection, but this doesn't work. My guess is that there's some data held somewhere in memory, as the connection is gone after a reboot.
I wonder if anybody knows how to get rid of the connection without rebooting or doing it manually?
You need to use the gconf tool (gconftool or gconftool-2@in terminal, can't remember if you need to install something first) to manage configuration keys in the registry, messing about with related files will only get you in trouble.
Writing a small script to delete all but predefined connections should be fairly simple task (and there are more direct interfaces to gconf in various programming languages, I would recommend Python).