On Windows Vista, to install IIS 7.0 from the command line, you can use a tool called the Windows Package Manager (Pkgmgr.exe). For example, the command line for installing IIS 7. 0 on Windows Vista might look something like the following depending on how many IIS features you want to install:

start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;

This has changed in Windows 7. In Windows 7, the Package Manager is deprecated and replaced with the Deployment Image Servicing and Management (DISM.exe) tool. To install IIS 7.5 on Windows 7, you use DISM.exe to target the running operating system (using the /Online switch) and use the /Enable-Feature option to enable individual IIS features. Below is the command line for installing all of IIS 7.5 features on Windows 7. NOTE: I have put each feature on a separate line to make it easier to read. In practice, the entire command line needs to be on a single line.

START /WAIT DISM /Online /Enable-Feature/FeatureName:IIS-ApplicationDevelopment/FeatureName:IIS-ASP/FeatureName:IIS-ASPNET/FeatureName:IIS-BasicAuthentication/FeatureName:IIS-CGI/FeatureName:IIS-ClientCertificateMappingAuthentication/FeatureName:IIS-CommonHttpFeatures/FeatureName:IIS-CustomLogging/FeatureName:IIS-DefaultDocument/FeatureName:IIS-DigestAuthentication/FeatureName:IIS-DirectoryBrowsing/FeatureName:IIS-FTPExtensibility/FeatureName:IIS-FTPServer/FeatureName:IIS-FTPSvc/FeatureName:IIS-HealthAndDiagnostics/FeatureName:IIS-HostableWebCore/FeatureName:IIS-HttpCompressionDynamic/FeatureName:IIS-HttpCompressionStatic/FeatureName:IIS-HttpErrors/FeatureName:IIS-HttpLogging/FeatureName:IIS-HttpRedirect/FeatureName:IIS-HttpTracing/FeatureName:IIS-IIS6ManagementCompatibility/FeatureName:IIS-IISCertificateMappingAuthentication/FeatureName:IIS-IPSecurity/FeatureName:IIS-ISAPIExtensions/FeatureName:IIS-ISAPIFilter/FeatureName:IIS-LegacyScripts/FeatureName:IIS-LegacySnapIn/FeatureName:IIS-LoggingLibraries/FeatureName:IIS-ManagementConsole/FeatureName:IIS-ManagementScriptingTools/FeatureName:IIS-ManagementService/FeatureName:IIS-Metabase/FeatureName:IIS-NetFxExtensibility/FeatureName:IIS-ODBCLogging/FeatureName:IIS-Performance/FeatureName:IIS-RequestFiltering/FeatureName:IIS-RequestMonitor/FeatureName:IIS-Security/FeatureName:IIS-ServerSideIncludes/FeatureName:IIS-StaticContent/FeatureName:IIS-URLAuthorization/FeatureName:IIS-WebDAV/FeatureName:IIS-WebServer/FeatureName:IIS-WebServerManagementTools/FeatureName:IIS-WebServerRole/FeatureName:IIS-WindowsAuthentication/FeatureName:IIS-WMICompatibility/FeatureName:WAS-ConfigurationAPI/FeatureName:WAS-NetFxEnvironment/FeatureName:WAS-ProcessModel/FeatureName:WAS-WindowsActivationService

Habib Heydarian.