• Simple cmd code don't work
    7 replies, posted
I have made a code to start all of my games, but when I type a number it does something weird. [code]@echo off echo Choose the game you would like to play. echo - echo - echo List of games: echo - echo 1. Garry's mod echo 2. TF2 echo 3. Burnout Paradise echo 4. Fallout 3 echo 5. Call of Duty: World at War echo 6. Mirrors Edge echo 7. Source SDK echo 8. Bioshock echo 9. GTA:SA echo 10. BF2 REM cls set/p "cho=>" if %cho%==1 goto Gmod if %cho%==2 goto TF2 if %cho%==3 goto Burnout if %cho%==4 goto FO3 if %cho%==5 goto CODWAW if %cho%==6 goto ME if %cho%==7 goto SDK if %cho%==8 goto Bioshock if %cho%==9 goto GTASA if %cho%==10 goto BF2 :Gmod start "mm" /d "the path" -game garrysmod +exec "gameinfo.txt" -console :END :TF2 start "mm" /d "the path" -console :END :Burnout start "mm" /d "the path" :END :Fo3 start "mm" /d "the path" :END :CODWAW start "mm" /d "the path" :END :ME start "mm" /d "the path" :END :SDK start "mm" /d "the path" -applaunch 211 :END :Bioshock start "mm" /d "the path" :END :GTASA start "mm" /d "the path" :END :BF2 start "mm" /d "the path" +menu 1 +fullscreen 1 :END exit [/code] The errors... [img_thumb]http://dl.dropbox.com/u/3714349/cmd%20error.png[/img_thumb]
I'm guessing you need the shortcut commands (like +menu and -applaunch 211) inside the quotes of the path.
That didn't work. New code works: [code]@echo off echo Choose the game you would like to play. echo - echo - echo List of games: echo - echo 1. Garry's mod echo 2. TF2 echo 3. Burnout Paradise echo 4. Fallout 3 echo 5. Call of Duty: World at War echo 6. Mirrors Edge echo 7. Source SDK echo 8. Bioshock echo 9. GTA:SA echo 10. BF2 REM cls set/p "cho=>" if %cho%==1 goto Gmod if %cho%==2 goto TF2 if %cho%==3 goto Burnout if %cho%==4 goto FO3 if %cho%==5 goto CODWAW if %cho%==6 goto ME if %cho%==7 goto SDK if %cho%==8 goto Bioshock if %cho%==9 goto GTASA if %cho%==10 goto BF2 :Gmod start "mm" "C:\Program Files\Steam\steamapps\vexx21322\garrysmod\hl2.exe" -game garrysmod +exec "gameinfo.txt" -console" :END exit :TF2 start "mm" "C:\Program Files\Steam\steamapps\vexx213222\team fortress 2\hl2.exe" -game Team Fortress 2 +exec "gameinfo.txt" -console :END exit :Burnout start "mm" "C:\Program Files\Electronic Arts\Burnout(TM) Paradise The Ultimate Box\BurnoutParadise.exe" :END exit :Fo3 start "mm" "C:\Games\Fallout 3\Fallout3.exe" :END exit :CODWAW start "mm" "C:\Program Files\Activision\Call of Duty - World at War\CoDWaW.exe" :END exit :ME start "mm" "C:\Program Files\EA GAMES\Mirror's Edge\Binaries\MirrorsEdge.exe" :END exit :SDK start "mm" "C:\Program Files\Steam\Steam.exe" -applaunch 211 :END exit :Bioshock start "mm" "C:\Program Files\Bioshock\Builds\Release\Bioshock.exe" :END exit :GTASA start "mm" "C:\Program Files\Rockstar Games\GTA San Andreas\gta_sa.exe" :END exit :BF2 start "mm" "C:\Program Files\EA GAMES\Battlefield 2\BF2.exe" +menu 1 +fullscreen 1 :END exit [/code] The only problem that I have run into was that when I try to launch steam games, it gives me an error about a failed or missing DLL. [editline]02:20AM[/editline] "Failed to load the launched DLL"
[QUOTE=vexx21322;20020539]That didn't work. New code works: [code]@echo off echo Choose the game you would like to play. echo - echo - echo List of games: echo - echo 1. Garry's mod echo 2. TF2 echo 3. Burnout Paradise echo 4. Fallout 3 echo 5. Call of Duty: World at War echo 6. Mirrors Edge echo 7. Source SDK echo 8. Bioshock echo 9. GTA:SA echo 10. BF2 REM cls set/p "cho=>" if %cho%==1 goto Gmod if %cho%==2 goto TF2 if %cho%==3 goto Burnout if %cho%==4 goto FO3 if %cho%==5 goto CODWAW if %cho%==6 goto ME if %cho%==7 goto SDK if %cho%==8 goto Bioshock if %cho%==9 goto GTASA if %cho%==10 goto BF2 :Gmod start "mm" "C:\Program Files\Steam\steamapps\vexx21322\garrysmod\hl2.exe" -game garrysmod +exec "gameinfo.txt" -console" :END exit :TF2 start "mm" "C:\Program Files\Steam\steamapps\vexx213222\team fortress 2\hl2.exe" -game Team Fortress 2 +exec "gameinfo.txt" -console :END exit :Burnout start "mm" "C:\Program Files\Electronic Arts\Burnout(TM) Paradise The Ultimate Box\BurnoutParadise.exe" :END exit :Fo3 start "mm" "C:\Games\Fallout 3\Fallout3.exe" :END exit :CODWAW start "mm" "C:\Program Files\Activision\Call of Duty - World at War\CoDWaW.exe" :END exit :ME start "mm" "C:\Program Files\EA GAMES\Mirror's Edge\Binaries\MirrorsEdge.exe" :END exit :SDK start "mm" "C:\Program Files\Steam\Steam.exe" -applaunch 211 :END exit :Bioshock start "mm" "C:\Program Files\Bioshock\Builds\Release\Bioshock.exe" :END exit :GTASA start "mm" "C:\Program Files\Rockstar Games\GTA San Andreas\gta_sa.exe" :END exit :BF2 start "mm" "C:\Program Files\EA GAMES\Battlefield 2\BF2.exe" +menu 1 +fullscreen 1 :END exit [/code] The only problem that I have run into was that when I try to launch steam games, it gives me an error about a failed or missing DLL. [editline]02:20AM[/editline] "Failed to load the launched DLL"[/QUOTE] Launch the Steam games from the Steam.exe, with the -applaunch <App ID>
Thanks, that worked.
Well that sorta does what I want it to, just that it closes emidiantly after I choose the program, I know this is because of the exit command, but I added that in because it would execute all the programs not just the one I told it to. I want it to open the program I choose from the numbers then open that program, then stay open.
You want the batch file to stay open? Try this: put :BEGIN at the top after @echo off, then after each game replace the lines ":END", "exit" with "goto BEGIN".
Yeah that should work
Sorry, you need to Log In to post a reply to this thread.