Using batch file for running SQL Server Express with parameter silently

722 views Asked by At

I use this code for running Microsoft SQL Server 2008 R2 Express in silent mode but this program exit with error

@echo off
set DIRPATH=%~dp0%Sql Express 2008 R2
set Auth=""NT Authority\SYSTEM""
if exist "%DIRPATH%" goto installProg
echo file not found

goto end

:installProg 

start "Running Rahbordi App" "%DIRPATH%\SQLEXPR_x86_ENU" "/QS /HIDECONSOLE /ACTION=Install /IAcceptSQLServerLicenseTerms /FEATURES=SQL /INSTANCENAME=SQLEXPRESSR2 /SQLSVCACCOUNT=%Auth% /AddCurrentUserAsSQLAdmin"

:end 

Error:

SQL Server Setup has encountered the following error:

The argument '/QS /HIDECONSOLE /ACTION=INSTALL /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQL /INSTANCENAME=SQLEXPRESSR2 /SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /ADDCURRENTUSERASSQLADMIN' is formatted incorrectly.
The delimiter '=' is missing.

Error code 0x84B40006.

I don't know that why this error happen. Many thanks for any help.

Edit: ]n detail of error i just say that after NT an enter character printed.

0

There are 0 answers