code runs fine on win 7 arduino 1.6.6 but throws an error on win 10 with 1.8.5

I have a bit of sample code that I am using to get a handle on using a 20x4 LCD with i2c. On Win 7 with Arduino 1.6.6 it compiles and runs fine. On Win 10 with Arduino 1.8.5 it throws the following error:

Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino/Genuino Uno"

c:\program files\windowsapps\arduinollc.arduinoide_1.8.10.0_x86__mdqgnx93n4wtt\hardware\tools\avr\bin\../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe: unable to rename 'core\core.a'; reason: File exists

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The test code I’m trying to run is as follows

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
//i2c pins
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // 

void setup() 
{
//WE define our LCD 16 columns and 2 rows
lcd.begin(20,4);
lcd.backlight();//Power on the back light
//lcd.backlight(); Power off the back light

lcd.clear();//Clean the screen
lcd.setCursor(0,0); 
lcd.print("Camera Slide Rale");
lcd.setCursor(0,1);
lcd.print("crChisholm (C)");
lcd.setCursor(0,2);
lcd.print("Menu");

delay(8000);

}

void loop() 
{
}

I really need to run this in win 10 arduino 1.8.5. Any guidance on resolving this???

Is the sketch in a folder located on OneDrive? If so, that doesn't work unless you uncheck "files on demand" in the configuration of the OneDrive folder (or better yet, don't use onedrive for your sketches at all, and sync changes with real source control, ex, github)

It's either that or an overly aggressive antivirus program mistaking arduino IDE for malicious program, or interfering via realtime scanning (to be fair, the process of compiling a sketch results in scores of commands being invoked, all of which are creating or removing files, all in rapid succession). Disable antivirus and see if that fixes it - if it does, turn the antivirus back on, and consult the docs for the antivirus program to see how to "whitelist" the compile tools (the process for this varies between antivirus software).

No, the sketch folder is located in C:\Users\charl\Documents\Arduino. I uninstalled OneDrive because it was causing me issues. I do sometimes use dropbox, but in this case, the sketch is under the folder listed above. don't have a clue what all that is in the error message.

Do I need to uninstall Arduino IDE from the computer and try and clean everything out?

I don't think reinstalling helps here (afaik, nobody has reported it did on here); it's a system issue preventing the compiler from doing what it needs to do.

Did you check if it could be caused by antivirus, as I suggested above? A few people have said that McAfee can cause this.

Ok, after deleting anything to do with this sketch, making sure that oneDrive was not running, clearing temps, and whistling the "Andy Griffith" theme song, It started working. I guess there was still some vestige of oneDrive on my computer even though I deleted it with the last problem it caused me.

Thank you.

Well, I guess I can assume it wasn't AV since McAfee is still running and after deleting a bunch of stuff it started working. Turning off the AV to test would have been my next step.

Very strange. I would love to know what it was exactly that fixed it!

Yep, this has happened to me many times in a 38 year career developing systems. Something doesn't work alll of a sudden starts working. Mixed blessing: Your glad it works, but since you don't know what the problem was, you know you're still vulnerable to it. Most of the time you can credit some outside factor, but in a case like this, there is no "outside" to blame.

Maybe cable fleas :}