How to enable / disable Windows features programmatically

I want to enable / disable windows functions programmatically. This can usually be done using Control Panel -> Programs and Features -> Turn Windows feature on or off.

Are there any windows api for this? or any COM interface for this?


source to share

2 answers

You can use DismEnableFeature

that is part of the Deployment Servicing and Management (DISM) API .



you can use powershell script cmdlet and intall-windowsfeature:

Install-WindowsFeature -Name Web-Server

technology reference



All Articles