【发布时间】:2017-04-19 08:43:53
【问题描述】:
安装SQL Server Management Studio时可以更改默认安装路径C:吗?
我的 C: 驱动器已满,因为它有系统应用程序,我想在 D: 驱动器中安装 SQL Server Management Studio。这可能吗?
【问题讨论】:
标签: sql-server path installation ssms
安装SQL Server Management Studio时可以更改默认安装路径C:吗?
我的 C: 驱动器已满,因为它有系统应用程序,我想在 D: 驱动器中安装 SQL Server Management Studio。这可能吗?
【问题讨论】:
标签: sql-server path installation ssms
没有直接的方法(终于现在)来更改默认的 SQL Server Management Studio 安装路径但是您可以使用 符号链接:
来自The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows:
符号链接基本上是高级快捷方式。创建指向单个文件或文件夹的符号链接,该链接看起来与指向 Windows 的文件或文件夹相同,即使它只是指向文件或文件夹的链接。
Windows 10 用户必须先从
启用开发者模式设置 > 更新和安全 > 对于开发者。
Command Prompt或Windows PowerShell并在安装SQL Server Management Studio之前粘贴此命令mkdir "D:\Program Files\Microsoft SQL Server" mkdir "D:\Program Files (x86)\Microsoft SQL Server" mklink /J "C:\Program Files\Microsoft SQL Server" "D:\Program Files\Microsoft SQL Server" mklink /J "C:\Program Files (x86)\Microsoft SQL Server" "D:\Program Files (x86)\Microsoft SQL Server"
驱动器
C中可能还有其他文件和文件夹,例如AppData\Local\Microsoft\Microsoft SQL Server但它们并不大 超过 1GB。
关闭所有 SSMS 实例并将这些文件夹重命名为您想要的任何名称:
C:\Program Files\Microsoft SQL Server
C:\Program Files (x86)\Microsoft SQL Server
按照操作方法步骤,将文件夹的内容(剪切/粘贴)移动到新位置
D:\Program Files\Microsoft SQL Server
D:\Program Files (x86)\Microsoft SQL Server
【讨论】:
是的,可以从 SSMS 18.0 开始。
SQL Server Management Studio (SSMS) 18.0 released for general availability
SSMS 可以安装在自定义文件夹中——这是一个长期存在的要求。使用 SSMS 18,您可以在任何文件夹中安装 SSMS,并且该选项可从命令行和设置 UI 中使用。
【讨论】:
Ver 18.0 时帮助了我。
这样做需要使用 powershell 脚本更新注册表值,然后运行安装,安装后注册表值重置为默认值
$RegKey =”HKLM:\Software\Microsoft\Windows\CurrentVersion”
Set-ItemProperty -Path $RegKey -Name “ProgramFilesDir” -Value “D:\Program Files”
Set-ItemProperty -Path $RegKey -Name “ProgramFilesDir (x86)” -Value ‘D:\Program Files (x86)’
Get-ItemProperty -Path $RegKey -Name “ProgramFilesDir”
Get-ItemProperty -Path $RegKey -Name “ProgramFilesDir (x86)”
Write-Host “1. Run the SSMS installer and wait for its completion… (Start-Process -Wait)” -ForegroundColor Yellow
$process=”D:\Software\SSMS-Setup-ENU.exe”
$args=”/install”
Start-Process $process -ArgumentList $args -Wait
Write-Host “`nProcess `”$process`” has been executed and is now stopped.” -ForegroundColor DarkGreen
$RegKey =”HKLM:\Software\Microsoft\Windows\CurrentVersion”
Set-ItemProperty -Path $RegKey -Name “ProgramFilesDir” -Value “C:\Program Files”
Set-ItemProperty -Path $RegKey -Name “ProgramFilesDir (x86)” -Value ‘C:\Program Files (x86)’
Get-ItemProperty -Path $RegKey -Name “ProgramFilesDir”
Get-ItemProperty -Path $RegKey -Name “ProgramFilesDir (x86)”
将开始菜单中图标的位置更新为 SSMS 文件的更新位置。
就我而言,我必须浏览到
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft SQL Server Tools 17
右键单击 SSMS 并将目标更新到 SSMS 程序文件的新位置,一切就绪。有关详细说明 https://sqlx86.com/2018/06/28/installing-ssms-to-a-different-location/
【讨论】:
我之前已经回答了这篇文章,通过编辑注册表值使用 powershell 来做到这一点。
从那时起,我尝试了不同的方法,在这里我再次采用了一种新方法,将 SQL Server management Studio 从命令行安装到用户所需的路径。
步骤如下
从此link下载最新版本的SSMS
按 Win+Q 键在您的计算机上打开搜索并输入 cmd,在右侧窗格中单击以管理员身份运行。
“SSMS-Setup-ENU.exe /Install /quiet /norestart /log D:\Test\log.txt SSMSInstallRoot = D:\test”
你们都准备好了……
有关屏幕截图的说明,请访问 https://sqlx86.com/2018/12/27/change-the-default-installation-path-for-sql-server-management-studio-using-command-prompt/
【讨论】:
C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Ssms.exe
我按照微软支持https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017给出的说明进行操作
我修复了 Visual Studio 2015 IsoShell,它对我有用。
【讨论】: