Programs> Turn Windows Features On...">

How can you programmatically disable or use the "Windows Properties",

Currently, users must go to Control Panel> Programs> Turn Windows Features On or Off, and then check the box for the feature they want to activate. I would like to give them the opportunity to do this from my application.

Any idea on how to automate this process through .NET (preferably in C #)?

+6
source share
2 answers

I am using NSIS for IIS using:

$Sysdir\pkgmgr.exe /n:$Temp\iis7Unattend.xml 

You can call the pkgmgr program from your C # program, and usually you should create an unattended installation file with instructions for pkgmgr to use for this function.

You need to use

  System.Diagnostics.Process.Start(). 
0
source

If you focus only on new platforms (> = Windows Vista), then dis.exe is the latest utility; it replaces pkgmgr.

Call example (for all necessary functions):

 dism.exe /online /enable-feature /featurename:IIS-WebServerRole 

To find a function, use this

 dism.exe /online /get-features | find "Tablet" 

see http://adriank.org/microsoft-ocsetupdism-component-name-list/ for more information.

+8
source

Source: https://habr.com/ru/post/901050/


All Articles