I'm trying to install IIS via command line from c# using the below code. When executed, it appears to run without error but when I check programs and features, IIS isn't installed. I've looked through my code and can't find any problems with it. Figured maybe someone here could see something I didn't.
string command = "START /WAIT DISM /Online /Enable-Feature /FeatureName:IIS-IIS6ManagementCompatibility /FeatureName:IIS-ManagementConsole /FeatureName:IIS-Metabase /FeatureName:IIS-ApplicationDevelopment /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-ASP /FeatureName:IIS-ASPNET /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-DefaultDocument /FeatureName:IIS-IIS6ManagementConsole /FeatureName:IIS-StaticContent /FeatureName:IIS-WebServer /FeatureName:IIS-WebServerRole";
ProcessStartInfo pStartInfo = new ProcessStartInfo("c:\\windows\\sysnative\\cmd.exe", "/c " + command);
Process p = new Process();
p.StartInfo = pStartInfo;
p.Start();
p.WaitForExit();