Activating and Deactivating Features Programmatically
You can activate/deactivate features using command-line utility called STSADM.EXE. Another approach is to do the same thing using the rich object model of WSS.
I have added an additional functionality in the utility. This functionality will automatically search for all the sites/sub sites on the Sharepoint Server where this utility will be run.
I have also created a solution for the same. You can download the same from here