Revert Cursor file associations and icons

I use Cursor on Windows 10. I love Cursor, but I don’t love how it changed the icon of py files to the Cursor icon, and made Cursor the default program for opening Python files. How do I revert all the file associations and icons that Cursor set?

Thanks for your help,
Ram Rachum.

I had the same issue, and running these commands in PowerShell as administrator fixed the problem for me.

# Remove all .py associations
Remove-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.py" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "HKEY_CLASSES_ROOT\.py" -Recurse -Force -ErrorAction SilentlyContinue

# Remove Cursor specific associations
Remove-Item -Path "HKEY_CLASSES_ROOT\Applications\cursor.exe" -Recurse -Force -ErrorAction SilentlyContinue

# Recreate Python associations
New-Item -Path "HKCU:\Software\Classes\.py" -Force
Set-ItemProperty -Path "HKCU:\Software\Classes\.py" -Name "(Default)" -Value "Python.File"

# Force the association again
cmd /c assoc .py=Python.File
cmd /c ftype Python.File="C:\Windows\py.exe" "%1" %*

# Restart Explorer
Stop-Process -Name explorer -Force
Start-Process explorer

(The sonnet 3.5 who created this)

Seems to work, thank you. However, Cursor does the same cursed thing to many other extensions, such as js. I hope I won’t have to do this exercise for all of them?