Commands for installing Sqlcmd Tools without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With winget
PowerShell
winget install --id Microsoft.Sqlcmd -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.Sqlcmd -e --silentwinget uninstall --id Microsoft.Sqlcmd -e --silentBy installer
64-bit · MSI · All users · en-US
Silent install
msiexec /i sqlcmd-amd64.msi /qn /norestart /qnWrite a log
msiexec /i sqlcmd-amd64.msi /qn /norestart /qn /l*v "%TEMP%\sqlcmd-tools-install.log"Uninstall
msiexec /x {A35E535D-B9AA-4753-89A8-B8D68638ABC7} /qn /norestart- MSI product code
- {A35E535D-B9AA-4753-89A8-B8D68638ABC7}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A35E535D-B9AA-4753-89A8-B8D68638ABC7}
- UpgradeCode
- {DD3ED7F3-F9EF-40BE-B3B3-34FA21D924FA}
- Install folder
- %ProgramFiles%\SqlCmd
64-bit · ZIP · en-US
No installation needed (portable)
ARM64 · MSI · All users · en-US
Silent install
msiexec /i sqlcmd-arm64.msi /qn /norestart /qnWrite a log
msiexec /i sqlcmd-arm64.msi /qn /norestart /qn /l*v "%TEMP%\sqlcmd-tools-install.log"Uninstall
msiexec /x {1B74F057-DD2F-470E-8E53-5304E5F76EAB} /qn /norestart- MSI product code
- {1B74F057-DD2F-470E-8E53-5304E5F76EAB}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1B74F057-DD2F-470E-8E53-5304E5F76EAB}
- UpgradeCode
- {DD3ED7F3-F9EF-40BE-B3B3-34FA21D924FA}
- Install folder
- %ProgramFiles%\SqlCmd
ARM64 · ZIP · en-US
No installation needed (portable)
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-sqlcmd-tools.ps1
$url = 'https://github.com/microsoft/go-sqlcmd/releases/download/v1.10.0/sqlcmd-amd64.msi'
$sha256 = '50C441F39C7087679BC23A957FD1AE1C67A0B47DFE7B93EF611921F41FD5697C'
$file = Join-Path $env:TEMP 'sqlcmd-amd64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart', '/qn' -Wait install-sqlcmd-tools.ps1
$url = 'https://github.com/microsoft/go-sqlcmd/releases/download/v1.10.0/sqlcmd-arm64.msi'
$sha256 = '7C82DECB3914A960494DE072FB0D9C6A16BE9A4269B7503451595D4FE45D0F4E'
$file = Join-Path $env:TEMP 'sqlcmd-arm64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart', '/qn' -Wait