- Published on
Resolve the Conflict Between VS Code `code` Command and Cursor `cursor` Command In Windows 11
- Authors

- Name
- Piggy DP
- @xiaozhudxiaozhu
Cursor is a recently popular AI editor. Before this, I was using the VS Code editor. However, after I downloaded Cursor, I encountered a conflict between the code command in VS Code and Cursor as the following:
When I use code . command in PowerShell, the editor that opens is Cursor instead of VS Code.

How to fix it:
- Find
codeandcursorcommand files
PowerShell (replace Username with your Username ):
Get-Command code
- Backup
code.cmdandcode
Copy-Item "C:\Users\Username\AppData\Local\Programs\cursor\resources\app\bin\code.cmd" "C:\Users\<Username>\AppData\Local\Programs\cursor\resources\app\bin\code.cmd.bak"
Copy-Item "C:\Users\Username\AppData\Local\Programs\cursor\resources\app\bin\code" "C:\Users\<Username>\AppData\Local\Programs\cursor\resources\app\bin\code.bak"
- Delete
code.cmdandcode
Remove-Item "C:\Users\Username\AppData\Local\Programs\cursor\resources\app\bin\code.cmd"
Remove-Item "C:\Users\Username\AppData\Local\Programs\cursor\resources\app\bin\code"

- And then we can use
codeto open VS Code