把下面这段命令完整复制,**关闭 Cursor 后**,用**管理员身份打开 PowerShell**,粘贴进去一次性执行:

**执行步骤:**

1. 在 Cursor 里**保存所有文件**,然后**关闭 Cursor**
2. 按 `Win + X` → 选"**Windows PowerShell(管理员)**"或"**终端(管理员)**"
3. 把上面的命令粘贴进去,按回车
4. 等待几分钟(移动文件需要时间)
5. 看到"**迁移完成!**"后,正常重新打开 Cursor 即可

# ========== Cursor AppData 迁移脚本(通用版)==========

# 第一步:强制结束所有 Cursor 进程
Write-Host "正在关闭 Cursor 进程..." -ForegroundColor Yellow
Stop-Process -Name "Cursor" -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2

$remaining = Get-Process | Where-Object {$_.Name -like "*cursor*"}
if ($remaining) {
    Write-Host "仍有 Cursor 进程运行,请手动关闭后重新执行!" -ForegroundColor Red
    exit
}
Write-Host "Cursor 已关闭。" -ForegroundColor Green

# 第二步:在 D 盘创建目标目录
Write-Host "正在创建目标目录 D:\AppData ..." -ForegroundColor Yellow
New-Item -ItemType Directory -Path "D:\AppData" -ErrorAction SilentlyContinue | Out-Null
Write-Host "目标目录已就绪。" -ForegroundColor Green

# 第三步:移动整个 Cursor 目录到 D 盘
Write-Host "正在移动文件,请耐心等待(约6GB,几分钟)..." -ForegroundColor Yellow
Move-Item "$env:APPDATA\Cursor" "D:\AppData\Cursor"

if (!(Test-Path "D:\AppData\Cursor")) {
    Write-Host "移动失败!请检查文件是否被占用。" -ForegroundColor Red
    exit
}
Write-Host "文件移动完成!" -ForegroundColor Green

# 第四步:在原位置创建 Junction 符号链接
Write-Host "正在创建符号链接..." -ForegroundColor Yellow
cmd /c mklink /J "$env:APPDATA\Cursor" "D:\AppData\Cursor"
Write-Host "符号链接创建完成!" -ForegroundColor Green

# 第五步:验证结果
Write-Host ""
Write-Host "===== 验证结果 =====" -ForegroundColor Cyan
$link = Get-Item "$env:APPDATA\Cursor"
Write-Host "链接类型: $($link.LinkType)"
Write-Host "指向目标: $($link.Target)"
$settingsOk = Test-Path "$env:APPDATA\Cursor\User\settings.json"
Write-Host "settings.json 可访问: $settingsOk"

$cFree = [math]::Round((Get-PSDrive C).Free / 1GB, 2)
Write-Host ""
Write-Host "C 盘当前剩余空间: $cFree GB" -ForegroundColor Green
Write-Host "迁移完成!现在可以正常启动 Cursor 了。" -ForegroundColor Green

迁移后 C 盘会腾出cursor的缓存空间,Cursor 功能完全不受影响。

Logo

欢迎加入DeepSeek 技术社区。在这里,你可以找到志同道合的朋友,共同探索AI技术的奥秘。

更多推荐