C++ Project Failed to Harvest Environment Variables

I’ve been having issues getting C++ classes to work for me. I have UE4.10 and am using Visual Studio 2015 Community running on a Windows 7 machine. I had managed to create a C++ project before but trying to add a class would result in a “failed to harvest environment variables” error when attempting to compile. I’ve been looking all over the internet for a solution. I’ve tried giving UE4 and the launcher admin privileges, running the batch files in my temp folder, and reinstalling Visual Studio (making sure the C++ stuff was selected). One solution I found was the fact that the (x86) in the program files folder might be getting in the way, so I uninstalled everything and moved them to a secondary drive. Now I’m hitting the error right when I try to create a C++ project in the wizard before the editor itself even pops up. I’m not sure what to do anymore. If anyone can help I’d love to know.