Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
ReFracture

Batch file tricks

Recommended Posts

I'm not really much for front ends, and I mostly use batch files for all my needs, but as you could imagine, I would have to edit the file by hand every time i wanted to use a different engine to play. Yeah, I know there are front ends. No, I don't want to use one.

I've done a little bit of searching and I haven't been able to find anything that seems to be useful, so I apologize if somebody finds an answer on their first google search attempt.

What I'm trying to do is take a batch file, place two (or more) possible commands in it, and have it execute one of those commands depending on which key I press. So for example, let's say I have these two commands for playing Alien Vendetta:

 
set DOOMSAVEDIR=.\engines\PrBoom+\Batch\Save\av
start .\engines\PrBoom+\batch\glboom-plus.exe -iwad .\engines\vanilla\doom2\doom2.wad -file .\pwads\av.wad -deh .\pwads\av.deh -complevel 2


and


start .\engines\gzdoom\batch\gzdoom.exe -iwad .\engines\vanilla\doom2\doom2.wad -file .\pwads\av.wad -file .\pwads\av.deh
As you could infer, one of those commands will launch the specified files using GlBoom-Plus, while the other will launch it using GZDoom.

Is there some way I can make the batch ask me which one I want and perform the according task I choose?

Share this post


Link to post
Mike.Reiner said:

Is there some way I can make the batch ask me which one I want and perform the according task I choose?

prboom-plus-2.5.0.2-win32.zip\start.bat

In NT based you can use something like:

set /p letter=[gzdoom (g) / prboom-plus (p)]

if "%letter%" == "g" (
  start gzdoom.exe
) else (
  start glboom-plus.exe
)
or
set /p letter=[g/p2/p9]

if "%letter%" == "g" goto gzdoom
if "%letter%" == "p2" goto prboom_complevel_2
if "%letter%" == "p9" goto prboom_complevel_9
goto end

:gzdoom
start gzdoom.exe
goto end

:prboom_complevel_2
set DOOMSAVEDIR=.\prboom-plus-saves\
start glboom-plus.exe -complevel 2
goto end

:prboom_complevel_9
start glboom-plus.exe -complevel 9
goto end

:end

Share this post


Link to post

Oh fantastic. Thank you very much!

I opted for the second option you provided, as I am setting the batch files to give me more than two options.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×