I'm looking for some example code that shows this stuff indicated in the subject. I have tried Googling it, but I'm not having any luck. Does anybody have a decent suggestion?
When you get it all set up again why don't you use an imaging program and
make a full backup? The next time something goes phooey you can just
restore from the backup instead of having to reinstall and upgrade.