[VS 2015] Backslash problem in command line

Hello.

I just installed VS 2015 Community and trying to upgrade an old project from 4.8 to 4.10 (the binary version from Epic launcher). I pulled the project from my Git repository and right-click on the .uproject and select 4.10 and generate a new .sln file. When I try to build, I get this error message:

1>  \Epic était inattendu.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(42,5): error MSB3073: The command ""C:\Program Files (x86)\Epic Games\4.10\Engine\Build\BatchFiles\Rebuild.bat" DialoguesEditor Win64 Development "E:\Documents\Unreal Projects\Galileen\Galileen.uproject" -rocket -waitmutex" exited with code 255.

Which is French for “\Epic was unexpected”, etc. It seems that the command it tried to run doesn’t like the space betwwen Epic and Games in the root directory of the engine.

Any hint on how to correct this ?

After investigating this a little more, it seems that installing the engine in “C:\Program Files (x86)” by default causes the compiler to not recognize anything past (x86) as a valid directory. To test my theory, I simliked this directory to a name with no such special characters and issued a manual compile with the command line and it compiled well.

So I then decided to install the Engine on another directory to avoid any further problems. I first tried to install it in C:\Program Files (next to the "C:\Program Files (x86) directory like in my old Windows 7 machine) but even if I selected that directory, the installer insisted to put it to “C:\Program Files (x86)”. So I then dediced to put it in my Documents folder instead and now it works.

I was running into this too and the problem is in "C:\Program Files (x86)\Epic Games\4.10\Engine\Build\BatchFiles\Rebuild.bat". The parentheses in the engine path seem to interfere with the IF (...) ELSE (...) statements.

For now I have fixed it by replacing every occurrence of %~dp0 with %~dps0 in order to use the short paths instead, which do not contain parenthesis (ex. "C:\PROGRA~2\...").

This worked for me. Thanks Jeff

I’m having the same problem, but I don’t understand this solution. Could you elaborate? Where and how did you change these?

Edit the file “C:\Program Files (x86)\Epic Games\4.10\Engine\Build\BatchFiles\Rebuild.bat” in a text editor. The path might be different depending on engine version and install location. Change any occurrences of “%~dp0” to “%~dps0”. You might want to make a backup of the file before you change it.

I had a similar issue. For me the solution was to add quotes around the %~dp0 in the echo statements. It seems that the parens in, for example, C:\Program Files (x86)\Epic Games\4.10\Engine\Build\BatchFiles interfere with the parens of the ELSE block. The original script ran fine from the command line, but not when launched by Visual Studio 2015.

@echo off

REM %1 is the game name
REM %2 is the platform name
REM %3 is the configuration name

IF EXIST "%~dp0\Clean.bat" (
	call "%~dp0\Clean.bat" %*
) ELSE (
	ECHO Clean.bat not found in "%~dp0" 
	EXIT /B 999
)

IF EXIST "%~dp0\Build.bat" (
	call "%~dp0\Build.bat" %*
) ELSE (
	ECHO Build.bat not found in "%~dp0" 
	EXIT /B 999
)

See also:
https://github.com/EpicGames/UnrealEngine/pull/2210

P.S. Duplicate of:

Thank you . work for me.

Thanks this worked for me as stated the (x86) is the issue here this solution worked just copy paste over the Rebuild.bat file