SQL2008R2_WIN2012_install 自动安装批处理

@echo off
 
if not exist "setup.exe" (
        echo 错误:没有发现 MSSQL 安装文件,请确认批处理位于安装包根目录,且补丁文件也在此目录
        pause
        exit
)

::设置SQL账户密码永不过期

::wmic /? 1>nul 2>nul
::wmic path Win32_UserAccount where name='sqlsrvuser' set  PasswordExpires=false
::wmic path Win32_UserAccount where name='sqlagtuser' set  PasswordExpires=false
 
 
echo 安装 .Net Framework
Setup.exe /QS
 
Setup.exe ^
/QS /ACTION=Install ^
/IACCEPTSQLSERVERLICENSETERMS ^
/FEATURES=SQL,Tools ^
/INSTANCENAME=MSSQLSERVER ^
/INDICATEPROGRESS ^
/INSTALLSQLDATADIR="D:\sqldata\MSSQL\Data" ^
/SQLTEMPDBDIR="D:\sqldata\MSSQL\Data" ^
/SQLTEMPDBLOGDIR="D:\sqldata\MSSQL\Log" ^
/SQLBACKUPDIR="D:\sqldata\MSSQL\Backup" ^
/SQLUSERDBDIR="D:\sqldata\MSSQL\Data" ^
/SQLUSERDBLOGDIR="D:\sqldata\MSSQL\Log" ^
/AGTSVCACCOUNT="NT AUTHORITY\SYSTEM" ^
/AGTSVCSTARTUPTYPE="Automatic" ^
/SQLSVCSTARTUPTYPE="Automatic" ^
/SECURITYMODE="SQL" ^
/SAPWD="password" ^
/SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" ^
/SQLSYSADMINACCOUNTS="Administrator"
 
SQLServer2008R2SP1-KB2528583-x64-CHS.exe /qs /Action=Patch /allinstances /IACCEPTSQLSERVERLICENSETERMS
SQLServer2008R2SP2-KB2630458-x64-CHS.exe /qs /Action=Patch /allinstances /IACCEPTSQLSERVERLICENSETERMS
pause

还没有评论,快来抢沙发!

发表评论

  • 😉
  • 😐
  • 😡
  • 😈
  • 🙂
  • 😯
  • 🙁
  • 🙄
  • 😛
  • 😳
  • 😮
  • emoji-mrgree
  • 😆
  • 💡
  • 😀
  • 👿
  • 😥
  • 😎
  • ➡
  • 😕
  • ❓
  • ❗
  • 67 queries in 0.378 seconds