Currently, users must go into Control Panel > Programs > Turn Windows features on or off, then click on the check the box of the feature that they want to activate. I'd like to give them the ability to do this from my application.
Any idea on how to automate this process via .NET (preferably in C#)?
If you are only targeting newer platforms (>= Windows Vista) then dism.exe is the latest utility; it replaces pkgmgr.
Example call (run for all required features):
dism.exe /online /enable-feature /featurename:IIS-WebServerRole
To find a feature, use this
dism.exe /online /get-features | find “Tablet”
see: http://adriank.org/microsoft-ocsetupdism-component-name-list/ for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With