自动化安装Sql Server 2008 R2 脚本

1、自动化安装IIS8
echo 正在添加IIS8功能,这可能需要几分钟时间...   
start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET45;IIS-NetFxExtensibility45;NetFx4Extended-ASPNET45;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI   
echo IIS8安装成功! 
2、自动化安装数据库
@echo 正在安装数据库,这可能需要几分钟时间... 
cn_sql_server_2008_r2_express_x64.exe /QS /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SECURITYMODE=SQL /SAPWD="sa123456" /IACCEPTSQLSERVERLICENSETERMS /TCPENABLED="1" /NPENABLED="1" /BROWSERSVCSTARTUPTYPE="Automatic" /AGTSVCSTARTUPTYPE="Automatic" 
echo 数据库安装成功!
3、自动化安装数据库管理工具
@echo 正在安装数据库管理工具,这可能需要几分钟时间... 
cn_sql_server_2008_r2_management_studio_express_x64.exe /QS /ACTION=Install /FEATURES=SSMS /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SECURITYMODE=SQL /SAPWD="sa123456" /IACCEPTSQLSERVERLICENSETERMS /TCPENABLED="1" /NPENABLED="1" /BROWSERSVCSTARTUPTYPE="Automatic" /AGTSVCSTARTUPTYPE="Automatic"
echo 数据库管理工具安装成功!
4、启动要安装的程序
@echo 正在安装采集端
start setup.exe
5、完整脚本

新建install.bat的文件

@echo off
cls
echo 正在添加IIS8功能,这可能需要几分钟时间...   
start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET45;IIS-NetFxExtensibility45;NetFx4Extended-ASPNET45;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI   
echo IIS8安装成功!  

@echo 正在安装数据库,这可能需要几分钟时间... 
cn_sql_server_2008_r2_express_x64.exe /QS /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SECURITYMODE=SQL /SAPWD="sa123456" /IACCEPTSQLSERVERLICENSETERMS /TCPENABLED="1" /NPENABLED="1" /BROWSERSVCSTARTUPTYPE="Automatic" /AGTSVCSTARTUPTYPE="Automatic" 
echo 数据库安装成功!

@echo 正在安装数据库管理工具,这可能需要几分钟时间... 
cn_sql_server_2008_r2_management_studio_express_x64.exe /QS /ACTION=Install /FEATURES=SSMS /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SECURITYMODE=SQL /SAPWD="sa123456" /IACCEPTSQLSERVERLICENSETERMS /TCPENABLED="1" /NPENABLED="1" /BROWSERSVCSTARTUPTYPE="Automatic" /AGTSVCSTARTUPTYPE="Automatic"
echo 数据库管理工具安装成功!

@echo 正在安装采集端
start setup.exe

猜你喜欢

转载自blog.csdn.net/haoqi9999/article/details/81629555