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)

1 Like

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?

I was a director of devops for a lot of names you know.

(at director level - im generally dealing with project plans and CFOs inability to understand technology)

The fundemental GREATNESS of an@Cursor agent to have admin access to my personal machines is that I know exactly how to prompt them to do super senior sysad stuff…

On my Shiny_Objects’ ToDo list is to bring up the other laptop and have it fully configured to spec through my @cursor bot.

Ive already had it do various things to my other machines - but I want to bring up a vanila box (either W10 or Ubuntu, havent picked yet) – but to have the machine be managed by my @cursor bot – but I want it to pull from the @claude_cli MCP for some more refined options and then, and this is good advice:

Every execution is wrapped into a .ps1 in a /scripts dir, and the descreptions and invocations are stored in .md and in a sqlite3 db - and an alias function to be able to pull the tools out as required – and the descriptions are to be a useable prompt by bot, such that I can query the tool library s1lite and say “from the tools give me XYZ” in the furture.

I already wrap ALL agentic actions in .ps1s with a geood header such that in addition to the development_diary.rmd I always keep - I have a lit library of every agentic command run.

(and obv specStory (I made a tool that was better than spec story, but I lost it in the Hallucination Wars of 2024