Hello dear friends, this error happened to me when installing UE4 4.25 I found out that the 2019 version of visual studio was giving an error, I don’t know why.
uninstalled and installed Visual Studio Community 2017 (version 15.9), did the procedure again and the file “GenerateProjectFiles.bat” worked normally!
follow the links of the installations made:
Visual Studio 2017 (version 15.9)
Visual Studio Older Downloads - 2017, 2015 & Previous Versions
Developer Pack .NET Framework 4.6.2 SDK
Download .NET Framework 4.6.2 Developer Pack Offline Installer
I hope it helps!