Re: Help needed with DOS commands for BAT file
My test set up is Bare Geomod in a Steam custom installation, using the mod's BAT file:
D:\Steam\steamapps\common\Medieval II Total War\mods\bare_geomod\universal start.bat
I would need the full path if I wanted to change directly from the mod's folder to the game's data folder. That simply won't work other then on my machine hence I first went up two levels (from M2TW\mods\BG to M2TW) and then changed to the data sub folder (M2TW\data) present there:
cd ..\..
cd data
After that I went up one level again to M2TW to start executing the normal batch start:
cd .\..
Here is the final, working version using a 20 seconds timeout command (the new IDX\DAT files were generated in less then 10 seconds on my machine, but it's pretty fast):
Code:
@echo off
REM --- going up two levels to main game level
cd ..\..
REM --- going to the data subfolder and renaming the main game's animation folder
cd data
ren animations animations_backup
REM --- going back up one level to main game level
cd .\..
REM --- standard universal batch file
IF EXIST kingdoms.exe (start kingdoms.exe @%0\..\Configuration.cfg) ELSE (
IF EXIST medieval2.exe (start medieval2.exe @%0\..\Configuration.cfg) ELSE (
echo ERROR: Cannot find the M2TW or Kingdoms executable.
echo You probably installed Bare Geomod into the wrong folder.
pause
)
)
REM --- pausing the processing of commands for 20 seconds
timeout 20
REM --- reversing the renaming AFTER timeout has expired
REM !! no need to change levels, we are still at the main level
REM --- going to the data subfolder and renaming the main game's animation folder
cd data
ren animations_backup animations
Last edited by Gigantus; December 02, 2019 at 04:17 AM.