5thWolf Posted June 29, 2023 Share Posted June 29, 2023 (edited) Several games have an initial set up screen like this: Anyone know if it's possible to make a .bat that runs the game and inputs the options so I don't have to every time? Edited June 29, 2023 by 5thWolf Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 17, 2023 Author Share Posted July 17, 2023 Anyone? Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted July 17, 2023 Share Posted July 17, 2023 It looks like you can send keypresses via a batch file by incorporating Windows Scripting Host. I've never tried this myself but looks intriguing and appears simple enough. @if (@CodeSection == @Batch) @then @echo off CScript //nologo //E:JScript "%~F0" rem Run Your Game Here goto :EOF @end WScript.CreateObject("WScript.Shell").SendKeys("1"); https://stackoverflow.com/a/25373908/11132805 1 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 17, 2023 Author Share Posted July 17, 2023 Oh man I don't understand this one, just the very bottom part maybe. Would you be able to give me an example with "game.exe" and the end send script? Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted July 17, 2023 Share Posted July 17, 2023 To run ('start') your game (program), replace the Comment (rem [short for 'remark']) line with: start "C:\Path\Program.exe" If you're passing a parameter to the batch file, use: start "" "C:\Path\Program.exe" %1 If you have multiple parameters, use: (example showing 3 parameters) start "" "C:\Path\Program.exe" %1 %2 %3 The last line will press "1" on the keyboard for you which corresponds with "MOUSE" in your screenshot. Hint: change "1" to "2" for JOYSTICK. For a more thorough description of what's going on, click the link I gave you, and then click the 3rd link in his post ("Press Keyboard keys using a batch file"). BTW, I still haven't tested it and probably won't. So let us know when you get it working and what you came up with. 1 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 17, 2023 Author Share Posted July 17, 2023 Oh man your the best! Going to try it right now!! Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 17, 2023 Author Share Posted July 17, 2023 Hmmmm it just crashes. Is this coding for DOS? It reminds me of windows shortcut launching. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted July 17, 2023 Share Posted July 17, 2023 1 hour ago, 5thWolf said: Is this coding for DOS? Ya. A batch file. You can try opening the command prompt to the folder you have the batch file in and run the batch file from there to see what error(s) it gives. If you have command line parameters to pass to it, be sure to add those. 1 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 17, 2023 Author Share Posted July 17, 2023 Will do, will experiment. Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 17, 2023 Author Share Posted July 17, 2023 I get this error Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 17, 2023 Author Share Posted July 17, 2023 Having the start command crashes DOSBox. When I took it out it launched the game but the options did not input in the startup menu. Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 18, 2023 Author Share Posted July 18, 2023 I just took a peek at some other DOS games that have bat files and they all just state the EXE. I tried it with my bat file and it also ran the game properly. None of them have START "" Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted July 18, 2023 Share Posted July 18, 2023 What does the contents of your batch file look like? Ya, "Start" doesn't work from the command prompt. Only from within a batch file. Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 18, 2023 Author Share Posted July 18, 2023 (edited) The pic is the entire content. Edited July 18, 2023 by 5thWolf Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted July 18, 2023 Share Posted July 18, 2023 OK, looks like I missed something here. You're running the batch file from within DOSBox? That's completely different and I know nothing about DOSBox. Since DOSBox doesn't recognize "start", it probably won't recognize Windows Scripting Host commands either. So looks like you're back to square one. Sorry. 1 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted July 18, 2023 Author Share Posted July 18, 2023 (edited) Yeah I need DOS environment batch commands. I will keep researching and if I finally get it I will post it. Edited July 18, 2023 by 5thWolf Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.