What are the illegal chars in my GenerateProjectFiles.bat error?

When I run GenerateProjectFiles.bat (as administrator) for UE4.13 on Win10 I get the following error:

Files was unexpected at this time.
Setting up Unreal Engine 4 project files…
UnrealBuildTool Exception: System.TypeInitializationException: The type initializer for ‘UnrealBuildTool.VCProjectFileGenerator’ threw an exception. —> System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.Combine(String path1, String path2, String path3)
at UnrealBuildTool.WindowsPlatform.GetVSComnToolsPath(WindowsCompiler Compiler) in E:\Programs\UnrealEngine-4.13\ Engine\Source\Programs\UnrealBuildTool\Windows\UEBuildWindows.cs:line 708
at UnrealBuildTool.WindowsPlatform.get_Compiler() in E:\Programs\UnrealEngine-4.13\Engine\Source\Programs\UnrealBuildTool\Windows\UEBuildWindows.cs:line 493
at UnrealBuildTool.VCProjectFileGenerator…cctor() in E:\Programs\UnrealEngine-4.13\Engine\Source\Programs\UnrealBuildTool\System\VCProjectFileGenerator.cs:line 171
— End of inner exception stack trace —
at UnrealBuildTool.VCProjectFileGenerator…ctor(FileReference InOnlyGameProject)
at UnrealBuildTool.UnrealBuildTool.DoPostStartupStuffThatCanAccessConfigs(String[] Arguments) in E:\Programs\UnrealEngine-4.13\Engine\Source\Programs\UnrealBuildTool\System\UnrealBuildTool.cs:line 1280

GenerateProjectFiles ERROR: UnrealBuildTool was unable to generate project files.

My VSPath is “C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE”.

Any ideas what the offending character might be?

Thanks in advance!

Hello,

Could it be the ‘-’ in “E:\Programs\UnrealEngine-4.13”?
Since you are rebuilding the source, you might try to put some debug in the Unreal build tool at the line where there is an issue. Mainly, you could try to display the path that is causing the issue.

Thanks for your reply, Begounet. Please see the bottom of my query where the path causing the problem is visible.

I tried to look more on detail and better understand your problem with “VSPath”.
That is really weird :confused:
The function should relies on the characters described in here but there is not such characters in your path… I don’t know what I can recommend to you, sorry :confused:

My VSPath is “C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE”.

Are you absolutely certain that this the path that is evaluated ? Or did you presume it was this, because it is where your installation here ?

I looked at the source code of the file listed in the error (I’ve highlighted this above) to see what was causing the error:

return new DirectoryInfo(Path.Combine(VSPath, "..", "Tools")).FullName;

If you look to see where VSPath comes from, it points to a the InstallDir Registry Key for VS, and that is the where I got my VSPath from. Combine just concatenates the 3 strings together.

It’s bizarre.

Doh! I just worked it out - I had double-quotes around the path string in the Registry Key - removed those and it worked! Thank you so much for being my sounding board!!

Remove the double-quotes around the path string in the VS InstallDir Registry Key.