GenerateProjectFiles ERROR: We couldn't find a valid installation of Visual Studio

First Sorry For my poor English.

GenerateProjectFiles.bat running by double-clicking does not compile UE4 sourse code (Please see screenshot_3.png)

There are some informations in my computer:
OS: windows 10 x64

Visual Studio: Visual Studio 2017 (26430.16) Release (Please see screenshot_4.png)

Unreal Engine: 4.16.2 Release

VS150COMNTOOLS system variable: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools
(Please see screenshot_6.png)

What else to check ?

After it is added to the variable Path "C:\Windows\System32"
C:\Users\Paul.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Windows\System32\

Now when you start GenerateProjectFiles.bat, another error occurred:

Setting up Unreal Engine 4 project files…
C:\Program Files (x86)\Microsoft Visual studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(1111,5):
error MSB3644: reference assemblies for the platform “.NETFramework, Version = v4.5” were not found.
To eliminate this error Batch, install the SDK or targeting package for this version of the platform, or change the target application platform to
The version for which the SDK or the targeting package is installed. Note that the assembly will be resolved from the global cache collection
(GAC) and used instead of referenced assemblies. Therefore, they may misuse the selected platform as a Target.
[I:\UnrealEngine-release\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj]

GenerateProjectFiles ERROR: UnrealBuildTool failed to compile.

Press any key to continue . . .

(Error MSB3644: reference assemblies for the platform “.NETFramework, Version = v4.5” were not found)

Solution:

  1. Clean up the System from the “.NET Framework All Versions” using cleanup_tool (see screenshot_01)

Download place dotnetfx_cleanup_tool
Internet. Base tools. Net cleaning is available for download at the following locations:

Http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog_Tools/dotnetfx_cleanup_tool.zip

Restart windows


screenshot_01


2/. Reinstalling NET. Framework:
Run the installer vs_community_2017.exe, then click “change” to uncheck c NET.
After that, again “change” and tick off against NET. (see screenshot_02)


screenshot_02


3/. In GenerateProjectFiles.bat in line number 4 add " -2017" without the quotes (see screenshot_03)


screenshot_03


Starting GenerateProjectFiles.bat

But, in the end, the compilation in the visual studio itself did not work. Now installed UE4 version 4.16.3 on Linux, and everything works