Unable to open certain sketches

I am working on a new sketch and needed to review an older one but was unable to open several of my past sketches. I first get the "Unable to open sketch" error message. I was getting that a couple of weeks ago but found on the forum that I need to delete the "preferences" file, while I don't have a sketch open, then open a sketch. That worked and I have not gotten the message again until this morning.

After I click Ok on that message I get another one that says it failed to open that sketch and it shows the path to the folder.

I also noticed in Windows Explorer that some of the sketch folders are showing faded, the other folders are a solid color. The ones that are faded I can't open the sketch, I can go into the folder and see the sketch file that is in there. I even copied one of the files, created a new folder, pasted that one in, renamed it to match the folder and it still wont open. The sketches in the solid color folder I can open no problem. Also tried rebooting my computer.

What's going on?

Thanks
John

Try opening the sketch with a plain old text editor. If that works, copy and paste into a blank Arduino sketch.

I will try that

Thanks

gfvalvo

Before I did what you suggested I looked at the properties of the folders in question. For some unknown reason, virus or aliens, they had been set to hidden and read only. I unchecked those and can now open the sketches.

I'll have to see if I can find out why that happened and may be a good time to do a back up.

Thanks
John