Steam launch commands: a way to launch a little script?
I know you can personalize the launch of a game by adding specific commands on Steam. Can you add a command that runs a little .bat script?
Best Answer
No, but you can achieve the same result with a bit of a hack.
Launch arguments aren't related to batch files. You can use a batch file to launch something with launch arguments but not the other way around. However, if you want to launch the game through Steam and make the batch file run before the game, you can use the steps below to achieve that.
- Go to the game's installation folder and find the
.exefile for the game. Rename it from something likegame.exetogame_real.exe, for example. At the end of your batch file, add a command that runs your executable, obviously replacing
game_real.exewith your renamed game's executable:start "" game_real.exeFind a tool that compiles a
.batbatch file into a.exeexecutable. I haven't tested it but you could try this one at your own risk. Use this to compile your batch file. You may want to play around with the settings to make it not visible and whatever else you want.- Rename the resulting executable to the original name of the game's executable,
game.exein this example. Put this in the same folder as your game's executable.
That should be it. The batch file will run in place of the game when launched from Steam, then it will launch the actual game when it completes your desired actions. If the game has an update that changes the game's executable, your script will be replaced with that. Verifying the integrity of the game cache files will also replace your script with the real executable again. If that happens, just repeat these steps, discarding the old renamed game executable.
Pictures about "Steam launch commands: a way to launch a little script?"



How do I set launch parameters on Steam?
How do I add commands to launch options?
If you are having issues getting DRG to run, right-click the game in Steam, select Properties -> General and add -d3d11 to the launch options (-dx11 also works) to force DX11 instead.How do I force DX11 on Steam?
How to Launch Script Extender Instead of Game Through Steam
More answers regarding steam launch commands: a way to launch a little script?
Answer 2
For those Google pilgrims arriving in the future:
'Add a game...' ? 'Add a Non-Steam Game' ? 'Browse...' ? 'C:\Windows\System32\cmd.exe'.
On new shortcut "cmd.exe" ? 'Properties':
Name:
Awesome GameTarget:
"C:\Windows\System32\cmd.exe" /k C:\Location\Of\File.batStart In: the path your game lives in, like
"C:\Steam\steamapps\common\AwesomeGame"
Obviously, the .bat file should contain something like "start C:\Steam\steamapps\common\AwesomeGame\a_game.exe"
Answer 3
Short answer: No
The Steam launch commands are no different from adding launch commands to the application's shortcut. It depends on each application what they will or won't parse. You can't run any scripts or anything, unless the game itself has such functionality, in which case, it's not relevant to steam launch commands.
There are different ways of executing commands on software launch, one of them being AutoHotkey scripts, which allows automatic command execution when a process is detected.
Another way would be creating a batch file that will execute the command and then run the game executable, although that may not work with all games (mmorpg's with cheat protection specifically). @Keavon's answer explains how to create an executable out of a batch file, so you can run it directly through steam, rather than through a shortcut.
Answer 4
YES
- Create a shortcut of the steam game;
- Right-click the shortcut then go to 'Properties';
- Copy the URL;
- Go into the batch file and use start (the url without brackets)
For example my .bat file is:
@echo off
start steam://rungameid/730
cd D:\Desktop\csgo_dont_blind_me
start app.exe
exit
Answer 5
This is a bit late, but you can issue any OS shell commands by using the keyword %command%. If that keyword is present in the options, it will run whatever you put in the options field on the command-line (cmd.exe on Windows, /bin/sh on mac OS and Linux) and substitute the keyword with the game's executable. You can separate different commands with semicolons, just like on the command-line.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Kindel Media, Kindel Media, Pixabay, Pixabay
