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?

  • Can I influence my Steam region?
  • How can I get my Steam account to show youtube videos that are added?
  • How can I copy/transfer games via external hard drive?
  • Can the Steam achievements be gained also offline?
  • Just Cause 2 on Steam hanging on “Preparing to Launch”
  • Can I filter my Steam library by tags or features?
  • Is it at all possible to install Portal 2 purely from retail DVD?
  • How can I change the location Steam saves games on?
  • Can I bulk download Steam games?
  • How can I use an Xbox 360 controller to play Steam games?
  • Is there any way to hide your Steam status from others?
  • Do I need to buy the same steam game twice for two different operating systems?
  • 3 Solutions collect form web for “Steam launch commands: a way to launch a little script?”

    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.

    1. Go to the game’s installation folder and find the .exe file for the game. Rename it from something like game.exe to game_real.exe, for example.
    2. At the end of your batch file, add a command that runs your executable, obviously replacing game_real.exe with your renamed game’s executable:

      start "" game_real.exe

    3. Find a tool that compiles a .bat batch file into a .exe executable. 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.

    4. Rename the resulting executable to the original name of the game’s executable, game.exe in 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.

    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.

    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.

    We love Playing Games, especially Video Games.