Reputation: 25
I'm trying to edit a file by openning it via git using VS Code as an editor
$code texte.txt
and I got this
/c/Users/MAYA/AppData/Local/Programs/Microsoft VS Code/bin/code: line 61: /c/Users/MAYA/AppData/Local/Programs/Microsoft VS Code/Code.exe: Permission denied
I google it but didn' find anything usefull, any help please?
P.S: my environement: windows 7, MINGW64
Upvotes: 1
Views: 11284
Reputation: 2233
I was attempting to run the command from the Git Bash window on Windows when I got this error. I simply right-clicked the Git Bash icon and and chose "Run as administrator". After that I had no problem running the command.
Upvotes: 0
Reputation: 103
Thought it would be useful to share this as well.
WSL is not able to run VS Code with Windows environment administrator permissions.
Right-click on your Visual Studio Code shortcut and select "Properties" in C:\Users\<myUsername>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Visual Studio Code
In the Compatibility tab's settings section un-check "Run this program as an administrator"
A wonderful person brought this up on this Reddit post.
Upvotes: 1
Reputation: 25
I added the path from the Explorer's breadcrumb to Environment Variables under Advanced System Setting then I used $code.cmd file.extension
Upvotes: 0
Reputation: 25
Follow the steps below and be proud of the OS you use.
$code.cmd file.extension
Upvotes: 0