Welcome › Forums › General PowerShell Q&A › Install SQL Native Client Silent
- This topic has 7 replies, 3 voices, and was last updated 3 months, 2 weeks ago by
Participant.
-
AuthorPosts
-
-
October 13, 2020 at 8:50 am #262931
Hello..
The sqlncli.msi file is in the user roaming folder.
I’m trying to install with the following code:
I don’t get an error message, but the client is not installed.
Does anyone know what I’m doing wrong?
Thank you very much for your help …PowerShell123456789Clear$TmpPath = "$env:APPDATA\TmpCopyFiles\"$NativeFile = 'sqlncli.msi'$Arguments = @("/i", ('"{0}"' -f ($TmpPath.Replace('*','') + $NativeFile)),"/qn IACCEPTSQLNCLILICENSETERMS=YES")$ArgumentsStart-Process msiexec.exe -ArgumentList $Arguments -Wait -
October 13, 2020 at 12:39 pm #262980
Hello..
The sqlncli.msi file is in the user roaming folder.
I’m trying to install with the following code:
I don’t get an error message, but the client is not installed.
Does anyone know what I’m doing wrong?
Thank you very much for your help …
PowerShell
Press CTRL+C to Copy, CTRL+V to Paste<textarea class=”urvanov-syntax-highlighter-plain print-no” style=”tab-size: 4; font-size: 14px !important; line-height: 18px !important; z-index: 1; opacity: 1; height: 180px;” readonly=”readonly” data-settings=”dblclick”>Clear
$TmpPath = “$env:APPDATA\TmpCopyFiles\”
$NativeFile = ‘sqlncli.msi’$Arguments = @(“/i”, (‘”{0}”‘ -f ($TmpPath.Replace(‘*’,”) + $NativeFile)),”/qn IACCEPTSQLNCLILICENSETERMS=YES”)
$ArgumentsStart-Process msiexec.exe -ArgumentList $Arguments -Wait</textarea>
123456789Clear$TmpPath = “$env:APPDATA\TmpCopyFiles\”$NativeFile = ‘sqlncli.msi’$Arguments = @(“/i”, (‘”{0}”‘ -f ($TmpPath.Replace(‘*’,”) + $NativeFile)),“/qn IACCEPTSQLNCLILICENSETERMS=YES”)$ArgumentsStart-Process msiexec.exe -ArgumentList $Arguments -WaitSee if you are able to pass the arguments and use call operator
$cmd = "msiexec.exe” + " " + $Arguments& $cmd | out-null -
October 13, 2020 at 12:43 pm #262986
Hello..
The sqlncli.msi file is in the user roaming folder.
I’m trying to install with the following code:
I don’t get an error message, but the client is not installed.
Does anyone know what I’m doing wrong?
Thank you very much for your help …
PowerShell
<textarea class=”urvanov-syntax-highlighter-plain print-no” style=”tab-size: 4; font-size: 14px !important; line-height: 18px !important; z-index: 0; opacity: 0;” readonly=”readonly” data-settings=”dblclick”>Clear
$TmpPath = “$env:APPDATA\TmpCopyFiles\”
$NativeFile = ‘sqlncli.msi’$Arguments = @(“/i”, (‘”{0}”‘ -f ($TmpPath.Replace(‘*’,”) + $NativeFile)),”/qn IACCEPTSQLNCLILICENSETERMS=YES”)
$ArgumentsStart-Process msiexec.exe -ArgumentList $Arguments -Wait</textarea>
123456789Clear$TmpPath = “$env:APPDATA\TmpCopyFiles\”$NativeFile = ‘sqlncli.msi’$Arguments = @(“/i”, (‘”{0}”‘ -f ($TmpPath.Replace(‘*’,”) + $NativeFile)),“/qn IACCEPTSQLNCLILICENSETERMS=YES”)$ArgumentsStart-Process msiexec.exe -ArgumentList $Arguments -Waitsee if you are able to use call operator
$cmd = msiexec.exe + " "+ $Arguments& $cmd | out-null -
October 13, 2020 at 4:33 pm #263061
Also does not work
-
October 14, 2020 at 3:03 am #263202
I personally like to build command line arguments in an array. I’ve added a log for you to get more info in case it fails for you. I’ve tested this on several different systems with different operating systems.
PowerShell123456789$msiargs = @("/i""$env:APPDATA\TmpCopyFiles\sqlncli.msi""/qn""IACCEPTSQLNCLILICENSETERMS=YES""/L*V $env:temp\sqlNativeClientInstall.log")Start-Process msiexec -ArgumentList $msiargs -WaitIf it’s still not installing I would try the opposite architecture package (if 32 bit is failing try 64 bit or vice versa)
-
October 14, 2020 at 4:53 am #263223
I’m using your code, I found error 1603 in the log file.
I have now run the code as admin and it worked.Thank you for your help
PowerShell1Start-Process msiexec.exe -Verb RunAs -Wait -PassThru -ArgumentList "$Arguments"
-
-
AuthorPosts
- The topic ‘Install SQL Native Client Silent’ is closed to new replies.