Skip to content

Instantly share code, notes, and snippets.

@SirJackblue
Created March 7, 2016 08:45
Show Gist options
  • Save SirJackblue/dc9d8b7e001a994f17ee to your computer and use it in GitHub Desktop.
Save SirJackblue/dc9d8b7e001a994f17ee to your computer and use it in GitHub Desktop.
Simple batch file to launch an Unreal Engine 4 client or server or both of them :)
::Author: Jackblue
@echo off
:: Editable Variable
set "PROJECT_NAME=YourProjectName"
set UE_PATH="C:\path\to\your\unreal engine\UE4Editor.exe" ::By default : C:\Program Files\Epic Games\4.x\Engine\Binaries\Win64\UE4Editor.exe
set PROJECT_PATH="C:\path\to\your\YourProjectName.uproject"
:: You can edit arguments here (docs : https://docs.unrealengine.com/latest/INT/Programming/Basics/CommandLineArguments/index.html)
set "SERVER_COMMAND=%UE_PATH% %PROJECT_PATH% -server -log"
set "CLIENT_COMMAND=%UE_PATH% %PROJECT_PATH% -game -log"
:: Script
Title Starting %PROJECT_NAME%..
set /p LaunchMode="Launch mode [all(default)/server/client]:"
if "%LaunchMode%" == "server" goto :launchServer
if "%LaunchMode%" == "client" goto :launchClient
if NOT "%LaunchMode%" == "all" if NOT "%LaunchMode%"=="" exit
goto :launchAll
:launchServer
start "%PROJECT_NAME% - Dedicated Server" %SERVER_COMMAND%
exit
:launchClient
start "%PROJECT_NAME% - Client" %CLIENT_COMMAND%
exit
:launchAll
start "%PROJECT_NAME% - Dedicated Server" %SERVER_COMMAND%
start "%PROJECT_NAME% - Client" %CLIENT_COMMAND%
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment