C#C
C#3y ago
Ted Bunny

Batch script issue with spaces in strings

The script:
REM    This script copies your project's outputs into the game folders. Then it runs the game executable.
ECHO "======= POST-BUILD"

ECHO "    --- Defining directories"
SET destinationBepinex="C:\Program Files (x86)\Steam\steamapps\common\Streets of Rogue\BepInEx\"
SET destinationPlugins="%destinationBepinex%plugins\"
SET originPlugins=%cd%\

ECHO "    --- Defining series"
SET exportsPlugins=CCU.dll

ECHO "    --- Copying files"
FOR %%a IN (%exportsPlugins%) DO (XCOPY /s /y "%originPlugins%%%~a" %destinationPlugins%)

ECHO "    --- Running game"
SET executable="C:\Program Files (x86)\Steam\steamapps\common\Streets of Rogue\StreetsOfRogue.exe"
CALL "" "%executable%"
Output:
1>  "======= POST-BUILD"
1>  "    --- Defining directories"
1>  "    --- Defining series"
1>  "    --- Copying files"
1>  \Steam\steamapps\common\Streets was unexpected at this time.
Was this page helpful?