GenerateProjectFiles.bat "We couldn't find a valid installation of Visual Studio"

I have the following error described in other threads, but their solution doesn’t work for me so bare with me ; )
“GenerateProjectFiles ERROR: We couldn’t find a valid installation of Visual Studio. This program requires either Visual Studio 2013 or Visual Studio 2012. Ple ase check that you have Visual Studio installed, then verify that the HKEY_LOCAL _MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\InstallDir (or HKEY_LO CAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\InstallDir on 32-bit machines) registry value is set. Visual Studio configures this value when it is installed , and this program expects it to be set to the '\Common7\IDE' sub-folder under a valid Visual Studio installation directory.”

Here is my setup: I am runing W7 64bits with Visual Studio Community 2013
My Unreal engine repo is on the E drive, on: “E:\Projects\UnrealEngine”
My VS is installed here: “C:\Program Files (x86)\Microsoft Visual Studio 12.0”

I have a system variable: “VS120COMNTOOLS” = "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools"
I have "C:\Windows\System32" in my “Path” System variable.
I have a registry key in “HK_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VisualStudio\12” called “InstallDir” = "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE"

So I looked into solutions like: GenerateProjectFiles.bat doesn't recognize Visual Studio Ultimate 2013 - Programming & Scripting - Epic Developer Community Forums that didn’t help

And GenerateProjectFiles.bat not finding (VS 2013) - Getting Started & Setup - Epic Developer Community Forums that didn’t help either.

I uninstalled and re-installed VS to no avail
Re-downloaded the repo run ran Setup.bat again, no chance…
I’ve also tried to put the repo on the C drive.

Could it come from the fact that I am using VS 2013 Community ?

Thanks guys!

Update: I just installed Visual studio express, that didn’t change anything.

Okay solved it, The problem was that the PATH variable had two paths defines:

  • C:\Windows\System32;
  • C:\Windows\System32;

Removing the second one fixed it.
Also I am not sure if it works with VS Community