Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to install IIS in windows 2008 windows by C#
    primarykey
    data
    text
    <p>I got an batch file that contains:</p> <pre><code>start /w dism /online /enable-feature /featurename:IIS-WebServerRole start /w dism /online /enable-feature /featurename:IIS-WebServer start /w dism /online /enable-feature /featurename:IIS-IIS6ManagementCompatibility start /w dism /online /enable-feature /featurename:IIS-Metabase start /w dism /online /enable-feature /featurename:IIS-ManagementService start /w dism /online /enable-feature /featurename:IIS-HttpRedirect start /w dism /online /enable-feature /featurename:IIS-RequestMonitor start /w dism /online /enable-feature /featurename:IIS-BasicAuthentication start /w dism /online /enable-feature /featurename:IIS-WindowsAuthentication start /w dism /online /enable-feature /featurename:IIS-ISAPIExtensions start /w dism /online /enable-feature /featurename:IIS-ASP start /w dism /online /enable-feature /featurename:IIS-ISAPIFilter rem WIN 8 Only start /w dism /online /enable-feature /featurename:NetFx3 start /w dism /online /enable-feature /featurename:NetFx4Extended-ASPNET45 start /w dism /online /enable-feature /featurename:IIS-NetFxExtensibility start /w dism /online /enable-feature /featurename:IIS-ASPNET start /w dism /online /enable-feature /featurename:IIS-ServerSideIncludes rem WIN 8 Only start /w dism /online /enable-feature /featurename:IIS-NetFxExtensibility45 start /w dism /online /enable-feature /featurename:IIS-ASPNET45 echo IIS installation complete </code></pre> <p>Which will download IIS from internet and will install in local machine. I used C# code to call this <code>installiis.bat</code>. The code is</p> <pre><code>batchCommand = installiis.bat; procStartInfo = new ProcessStartInfo(); procStartInfo.WorkingDirectory = targetDir; procStartInfo.FileName = batchCommand; procStartInfo.Arguments = argument;//this is argument procStartInfo.CreateNoWindow = true; procStartInfo.UseShellExecute = true; procStartInfo.Verb = "runas"; proc.StartInfo = procStartInfo; proc.Start(); proc.WaitForExit(); </code></pre> <p>This code works perfectly in win7 and other platform but the batch file can not be started using C# code in <code>Windows 2008 Server</code> and <code>windows 8</code>. The command window immediately disappears after starting. But the same batch file works fine when I manually click and run as administrator. Anyone please give any solution.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload