5

I uploaded "mynewfolder" to Visual Studio Code, but when I do "New File" and write "index.html" under that I get this message:

Unable to write file (NoPermissions (FileSystemError): Error: EPERM: operation not permitted, open 'c:\Users\Projects\MyFirstPage\index.html')

I tried several times and still get the same error message.

enter image description here

Can anyone tell me what's going on?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Dave1984
  • 61
  • 1
  • 1
  • 3
  • Hi Dave, I had this problem before. I found that restarting the computer usually does the trick. Try that and tell us if it works for you. – ousecTic Dec 21 '19 at 20:11
  • Are you the only user on this PC? Are you the admin on thic PC? How did you install VS Code? – Gino Mempin Dec 21 '19 at 23:12
  • 1
    Yeah I restarted the pc and the same thing happens – Dave1984 Dec 21 '19 at 23:43
  • Yes im the only user on this pc. I installed VS code today,I followed all the steps. I’m new to coding and I’m following along on a course. – Dave1984 Dec 21 '19 at 23:48
  • Can you create the file/folder manually outside of VS Code? For example, by using Windows explorer. I'm guessing, when you installed VS Code, you did not give it the same permissions as your user account, so it can't create files/folders in your user folder. – Gino Mempin Dec 22 '19 at 02:02
  • I will try this and get back to you. I originally created a folder on c drive named “Projects” and within that folder I created “mynewfolder”. – Dave1984 Dec 22 '19 at 02:23

12 Answers12

5

I also meet this problem, now the problem has been solved. Please restart your PC and run your VSCODE as Administrator.

3

Just Run your VSCODE as Administrator.

1

The solution that worked for me is as follows (this works for Windows OS)

  1. Search for VSCode in the taskbar
  2. Right Click on VSCode and left click on "Open File Location"

File Explorer will open and Visual Studio Code will be shown

  1. Right Click on Visual Studio Code and select Properties
  2. A window will pop up displaying "Security, Details, Previous Versions, General, Shortcut and Compatibility" tabs
  3. Press on "Shortcut"
  4. Click "Advanced..."
  5. Another window will pop up display 2 tick boxes and select the box "Run as administrator"
  6. Click on OK
  7. Click on Apply / OK
  8. Open VSCode

The program will automatically run as Administrator.

If you have encounter any problems, do not hesistate to comment.

Anthony Mifsud
  • 112
  • 1
  • 10
0

I found if you shut down VS Code, go to c:\Users[you] and delete the folder .vscode (it may be hidden). Restart VS Code; you will be able to install extensions without a problem.

CAtoOH
  • 71
  • 1
  • 7
0

check your file permission privilege it should be on read and write.may be the hidden repositories in the folder check and delete it

Nelcon Croos
  • 71
  • 1
  • 5
  • Posting a screenshot from an Apple system as answer to an 1 yr. old, already solved problem on a Windows system is unlikely to be helpful. – AcK Jan 13 '21 at 18:32
0

Just "right click" on VS code app, go to "properties", then go to "shortcut", then go to "advanced" and tick on "run as administrator", click "apply" and open the VS code. This worked for me.

0

You can click right on this folder, choose Give access to, press specific people and delete all but not the Owner. It worked for me!

0

Running the visual Studio Code IDE with full authorization

run as administrator

will give permission to create a file in a folder. It worked in my case.

-2

It works for me,

RESTART pc then RUN visual studio code as ADMIN, finally open the project FOLDER

Aljohn Yamaro
  • 2,629
  • 25
  • 22
-2

DISABLE your Antivirus and then RETRY creating the file worked fine for me.

-2

Right click on your visual studio code and run as administrator.

-3

Restart your system, if the problem is not solved then Run VSCODE as Administrator. This worked for me.