unable to create new sketch

This is really crazy. I was using the Arduino IDE version 1.8.5 on a Windows 10 computer. I tried to figure out how to use the ESP8266 last week and after a few frustrating hours, I gave up.

This morning, I fired up the computer to work on another project (rotary encoder) and got a "could not create the sketch" as soon as the IDE opened. Also, the blink sketch was loaded as soon as I opened the IDE. I found that I could not create a new sketch. When I click New from the file menu, nothing happens. After trying several times, I decided that Arduino IDE had gotten corrupted, so I tried to uninstall it and got a message that it was open and I had to close it. I did not have it open at the time. I restarted the computer and tried to uninstall it again and got the same message that it was open, even though I had just restarted the computer. Thinking that it might be a temp file deal I did a disk cleanup and restarted again. This time it let me uninstall.

I reinstalled the IDE and when I opened the IDE, again it opened the blink sketch automatically and I got the same "could not create the sketch" alert box. I went in to try to create a new sketch and again nothing happened. Again I tried to uninstall and got the same message that Arduino was already open. I looked in preferences and strangly, the path to new libraries was still pointed to the ESP8266 URL, even though I had removed and reinstalled it. Also the board was set to the ESP8266 even though I had not reinstalled any libraries.. I changed it to the UNO and selected the correct port and tried to open a new sketch again and again, nothing happened.

I am really confused about what is going on and I hope that someone can offer some suggestions of where to go from here.

When you create a sketch the Arduino IDE needs to create temporary folders and files to store the sketch in its unsaved state. On Windows this folder is at C:\Users{user name}\AppData\Local\Temp. It will be something like C:\Users\per\AppData\Local\Temp\untitled1161440304.tmp\sketch_may19a. So I suspect the problem is that the IDE either doesn't have permissions to write to that location, can't access that location, or the drive is full.

I ended up dumping everything in the local\temp folder and that got me back were I needed to be. I don’t have a space issue and I have to assume that the IDE had permissions since everything in there was created by the IDE, but most everything in those folders seem to be related to my ill fated experiments with the ESP8266. I put that project on the back burner for now and everything seems to be ok.

Thanks