0

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
amir aziz
  • 1
  • 2
  • Try prefixing each `=` in the `start` line with a caret thus: `^=`. I'm not sure this will help, but it won't hurt. Another possibility is to simply delete the `start "Running Rahbordi App"` since the batch simply apparently termiantes after the `start` - you could set `title` before executing sqlexpr... but it may depend on your context. – Magoo Nov 21 '14 at 15:11
  • I hope `/ADDCURRENTUSERASSQLADMIN=TRUE` could help. – JosefZ Nov 21 '14 at 19:44
  • thanks [@JosefZ](http://stackoverflow.com/users/3439404/josefz) but this not work – amir aziz Nov 25 '14 at 16:48
  • I hope space between **NT AUTHORITY\SYSTEM** cause this error. I don't know how can set it to bat file!! – amir aziz Nov 25 '14 at 16:55

0 Answers0