Need help running a script before launching Hitman 3 (EGS)
I tried running this script:
@echo off
Start "" ".\Start Server.cmd"
Start "" ".\PeacockPatcher.exe"
Pretty simple. It works when launched manually, opens the two things I want etc. But when I select the .bat file containing the scrips under "Select a script to run before the game is launched" in Heroic the game just doesn't start anymore. the programs don't open and Heroic still tells me the game is launching. Do I have to rewrite it? Does it somehow break cause Heroic tries to run it somewhere else?
11 Replies
xenial-black•4mo ago
there seems to be a bug in heroic running before scripts on windows, check https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/issues/4248
GitHub
scripts do not work under Windows (pre / post launch) · Issue #4248...
Describe the bug Setting up a script under Windows (a .bat or .ps1 script, e.g. C:\test.bat) to run before a game is launched does not work, preventing the game from launching without any usable fe...
genetic-orangeOP•4mo ago
Oh
Well that sucks
But thanks for informing me
Any other way I could open these two programs in Heroic? Maybe through game arguments?
I'm really just looking for a way to open these two and Hitman 3 with one click. It's a custom server for the game but it needs to be run every time before the game launches. I already tried opening the game's launcher EXE with a script but that tries to call the EGS (com.epicgames.launcher)
xenial-black•4mo ago
maybe you can use a .bat file as alternative executable instead of a before script, and make the alternative executable open that first exe, wait some time, and then open the game's exe, similar to what's explained in https://discord.com/channels/812703221789097985/1210747284086849578/1210747284086849578
genetic-orangeOP•4mo ago

genetic-orangeOP•4mo ago
Well, like I said. Opening the game's launcher.exe always brings up this window
It only works when launched from Heroic
Is there maybe a way to tell Heroic to launch something from the command line? Maybe through Legendary stuff? Complete command noob.
xenial-black•4mo ago
legendary has its own config file to configure before scripts, check the
pre_launch_command
option https://github.com/derrod/legendary?tab=readme-ov-file#config-file
the config file is in ~/.config/heroic/legendaryConfig/legendary/config.ini
we don't recommend touching that file cuase some options can create issues with heroic, but I think it's safe to use that one configgenetic-orangeOP•4mo ago
I added this
[Hitman 3]
pre_launch_command = C:\Users\myname\Games\Peacock\Peacock-v7.6.1\peacock.bat
Doesn't work tho
Is the name wrong?
I tried both Hitman 3 and Eider
genetic-orangeOP•4mo ago
Do I need to use this app name?

genetic-orangeOP•4mo ago
The game launches this time but without the script
xenial-black•4mo ago
yes, you have to use that
Eider
name
I've never really used that option from legendary so I don't know if something is off, maybe check in settings > logs > ecpi/legendary to check if there's any error messagegenetic-orangeOP•4mo ago
I don't see anything
https://0x0.st/8Xr8.log
The only errors are cloud save related
[Legendary]
; Disables the automatic update check
disable_update_check = false
; Disables the notice about an available update on exit
disable_update_notice = false
[Legendary.aliases]
; List of aliases for simpler CLI use, in the format
<alias> = <app name>
HITMAN 3 = Eider
[Fortnite]
install_tags = ,core,br,core_highres,br_highres,br_sm6,stw
[HITMAN 3]
pre_launch_command = C:\Users\myname\Games\Peacock\Peacock-v7.6.1\peacock.bat
pre_launch_wait = true
That's my entire config.ini now