Comprehensive uninstall from Windows 11

I accidentally said to use both “code” and “cursor” commands from terminal for cursor so I uninstalled or at least tried to from Windows 11 but I guess there were artifacts left because when I downloaded again and reinstalled, it skipped that part and it also caused a conflict with VScode so neither command works. Right now I tried to go through in Powershell and delete as many artifacts as possible so now the “code” command works for VSCode. But I want to reinstall cursor and make sure only command “cursor” launches cursor and “code” launches VSCode. Can you tell me how to adjust these parameters after installation? Also how to totally purge cursor when I uninstall it?

nyck33@DESKTOP-B2AKE02:~/Development/func_langs/monday-morning-haskell$ cursor .
/mnt/c/Users/N.YC. Kim/AppData/Local/Programs/cursor/resources/app/bin/cursor: 61: /mnt/c/Users/N.YC. Kim/AppData/Local/Programs/cursor/resources/app/Cursor.exe: not found
nyck33@DESKTOP-B2AKE02:~/Development/func_langs/monday-morning-haskell$ code .
nyck33@DESKTOP-B2AKE02:~/Development/func_langs/monday-morning-haskell$

you should add it here:

What if users change their minds?

You can reinstall the “code” command from the original VSCode so that it overrides it again.

that’s not a solution. that’s leaning on vscode and the user quite a bit. that code . command comes activated by default when I install vscode so you want your users to do this manually rather than fix it? can you at least outline the steps? Also I just posted for version 0.27 something that I cannot connect to remote WSL. can you prioritize these items before making a bunch of new AI features as the current feature set is already quite good? but it’s clunky so that makes me think I shouldn’t renew my subscription or try out a competitor that is more polished in these areas when they are available.

I can’t uninstall and keep getting

To use Cursor with the Windows Subsystem for Linux, please install Cursor in Windows and uninstall the Linux version in WSL. You can then use the `cursor` command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyway? [y/N] y
To no longer see this prompt, start Cursor with the environment variable DONT_PROMPT_WSL_INSTALL defined.
/mnt/c/Users/nycki/AppData/Local/Programs/cursor/resources/app/bin/cursor: 62: /mnt/c/Users/nycki/AppData/Local/Programs/cursor/resources/app/bin/../cursor: not found
nyck33@lenovo-gtx1650:~/projects/scratch-graph-grader$ code .
nyck33@lenovo-gtx1650:~/projects/scratch-graph-grader$

upon reinstall.
I did all these steps except the registry stuff.

To perform the removal of residual files and clean up after uninstalling “Cursor” using PowerShell on Windows 11, you can follow these PowerShell commands. Please note that these commands should be used with caution, as incorrect usage can harm your system. It’s also advisable to run PowerShell as an Administrator.

Remove Residual Files

# Replace 'YourCursorInstallPath' with the actual installation path of Cursor
$cursorPath = "C:\Program Files\YourCursorInstallPath"
if (Test-Path $cursorPath) {
    Remove-Item -Recurse -Force $cursorPath
}

# Check the AppData folder for residual files
$appDataCursorPath = "$env:APPDATA\YourCursorAppData"
if (Test-Path $appDataCursorPath) {
    Remove-Item -Recurse -Force $appDataCursorPath
}

Clean the Registry

Please be extremely careful with this step; creating a backup of the registry is crucial before making changes.

# Backup the registry before making changes
$backupPath = "C:\RegistryBackup.reg"
reg export HKCU $backupPath

# Search and remove Cursor-related registry keys
# 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 }

Remove Startup Entries

Get-CimInstance Win32_StartupCommand | 
    Where-Object { $_.Caption -like "*Cursor*" } | 
    ForEach-Object { Remove-Item $_.Command -Force }

Check for Scheduled Tasks

# 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 }

Check Environment Variables

# 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") }

Make sure to replace any placeholder text with the actual paths and names related to “Cursor”. If you’re not sure about any command or its effect, it’s better to consult with someone who has more experience with PowerShell or Windows system administration before proceeding.