Last active
March 23, 2025 20:35
-
-
Save InTEGr8or/714490ee0ee86308dc89c21ee9451c67 to your computer and use it in GitHub Desktop.
Uninstall Cursor IDE PowerShell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(-Not $cursorPath -OR -NOT $appDataCursorPath){ | |
Write-Host "set `$cursorPath with the actual installation path of Cursor" | |
Write-Host "set `$appDataCursorPath with the actual installation path of Cursor" | |
} | |
Write-Host "Remove $cursorPath and it's contents" | |
if (Test-Path $cursorPath) { | |
Remove-Item -Recurse -Force $cursorPath | |
} | |
Write-Host "set `$appDataCursorPath with the actual installation path of Cursor" | |
Write-Host "Check the AppData folder for residual files" | |
if (Test-Path $appDataCursorPath) { | |
Remove-Item -Recurse -Force $appDataCursorPath | |
} | |
# Backup the registry before making changes | |
$backupPath = "D:\RegistryBackup.reg" | |
reg export HKCU $backupPath | |
Write-Host "Search and remove Cursor-related registry keys" | |
Write-Host "Caution: This is an advanced operation. Review each key before deleting." | |
Get-ChildItem -Path 'HKCU:\Software\', 'HKLM:\Software\' -Recurse -ErrorAction SilentlyContinue | | |
Where-Object { $_.Name -match "Cursor" } | | |
ForEach-Object { Remove-Item $_.PSPath -Force } | |
Get-CimInstance Win32_StartupCommand | | |
Where-Object { $_.Caption -like "*Cursor*" } | | |
ForEach-Object { Remove-Item $_.Command -Force } | |
Write-Host "List all scheduled tasks and remove those related to Cursor" | |
Get-ScheduledTask | | |
Where-Object { $_.TaskName -like "*Cursor*" } | | |
ForEach-Object { Unregister-ScheduledTask -TaskName $_.TaskName -Confirm:$false } | |
Write-Host "Check both User and System environment variables and remove entries related to Cursor" | |
[Environment]::GetEnvironmentVariables("User").Keys | | |
Where-Object { $_ -like "*Cursor*" } | | |
ForEach-Object { [Environment]::SetEnvironmentVariable($_, $null, "User") } | |
[Environment]::GetEnvironmentVariables("Machine").Keys | | |
Where-Object { $_ -like "*Cursor*" } | | |
ForEach-Object { [Environment]::SetEnvironmentVariable($_, $null, "Machine") } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment