I had this same issue with Vista years ago and it reappeared again today. I can compile a file to the desktop and copy it into a folder in C:\program files (x86), but I can't compile it directly there. I have admin rights as I have not changed them, I tried excluding the folder from Windows Defender, disabling UAC, I checked the rights to the folder and I have all rights (that is why I can copy something into it I suppose.
I am also now getting messages like this on occasion.
And to answer the classic question I have rebooted
Compile issues in C:\program files (x86) folders.
Moderators: Dorian (MJT support), JRL
Re: Compile issues in C:\program files (x86) folders.
After a couple of hours and gosh knows how many attempts it just started working again.