Can't save sketches - access is denied

I can't save sketches to my documents folder or folders under my documents. It offers to save in c:\users<myusername>. The permissions are the same on my documents so I'm not sure what the issue is.

In windows there are a set of folders that are the same name but off limits unless you are full administrator and logged in as such.

Windows is offering you the correct option to place them in YOUR folders.
It is doing its job of protecting the other ones.

Going to guess you have show hidden folders and system folders turned on which means you can see the ones it normally hides.

I am logged in with an account with administrative privileges. I can add files and folders just fine in that location when not using the IDE. The folder is mine since is is under c:\users<username>\my documents\arduino. There must be an issue with the user context the arduino IDE is running under.
The permissions are full control for administrators, my account and system.

Do you mean a user with admin privs or the FULL admin ?

There are two levels of admin on most win systems and a user with administrative privileges is not the same.
Even trying to take control of those folders may be denied.

I am using an account in the Administrators group.
The error is "java.io.IOException: Access denied" so this is related to the IDE saving files since I can save files to any directory just fine when not using the IDE.

I have windows access control turned off too.

This is not normal. You do not need admin privs to use the IDE, users should have the ability to write to their documents folder without any trouble.

Are you running the IDE normally? Is there anything unusual about your system configuration? Is it locked down with any third party security software that might be blocking writes from applications that aren't whitelisted?

I am not running it as admin. I'm just launching it normally.
There is nothing unusual that I can think of. I am running an antivirus program.
The funny thing is, it wants to save 2 directories up from where I am trying to save it and that works even though the permissions are the same.

It doesnt sound like the AV is the issue.
It still sounds as though windows is running as it should.

I agree with DrAzzy that you should not need to run as admin on a normal computer (not corporate or loaned or EDU etc etc. as they pose different issues)

Still think you may be misunderstanding the levels of permissions on folders as it is a complex issue.
Do you have "outright" ownership of those folders you cannot get to ?
I suspect as I said earlier that windows is doing what it is supposed to do and protect some folders and that you may be trying to save to those locations.

Do you have bitlocker enabled as that can cause some folder issues ?

Are you the sole owner of that computer from new ?

What AV are you running ?

Specifics would be a great help so I am going to suggest you read this

I have had this computer from new. I did upgrade to windows 10 a few months ago but I don't think I had the Arduino environment installed before that time.

I have a pretty good understanding of windows permission. Ownership is different than read, write and full control. I will need to check if my account is the owner of the folder by it shouldn't matter since my account has full control of that folder. I can add files, delete etc in that folder using file explorer and I always have been able to.

I don't have bitlocker installed.
I am currently using Bitdefender AV.

It sound like a Java setting to me.

IIRC there were a couple of posts about Bitdefender not too long ago and some issues with the Arduinos.

I dont think thats your issue but still worth checking with a search.

This problem is related to the Bitdefender installation. It has a safe file feature which when turned off allows me to save files again.

Thanks to everyone who offered to help.

Phew...glad you git it sorted out.

rbtgeek:
This problem is related to the Bitdefender installation. It has a safe file feature which when turned off allows me to save files again.

Thanks to everyone who offered to help.

I had the same problem and it is Bitdefender. I got around this by adding the Arduino IDE to the Application Access under file protect. Once restarting the IDE, this fixed the issue.

Here is how I did this:
Open Bitdefender
Click View features from the opening screen
Under safe files, go to application access
Click add new applications to the list
Find the arduino ide in your program files
click OK
Then make sure the slider is on Allowed

Then this problem went away for me. Hope this helps.

Thanks for that GK22...Karma added

It can also be solved by installing outside documents folder.

@FungreeenFox

I presume you mean setting the default sketches location ?
maybe that's why I had a problem creating the issue as I use portable or a seperate location for sketches.

But thanks for the tip.

Bob.