Added two batch files for easier packing/unpacking

This commit is contained in:
NovaRain
2024-04-21 11:35:40 +08:00
parent e5378bd9c2
commit fd4573e857
2 changed files with 52 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
@echo off
set "retdir=%CD%"
if "%~1" == "" (
echo:
echo Usage: packdat foldername [outputname]
exit /b
)
if not exist "%~1" (
echo:
echo Error: Folder not found
exit /b
)
set "datpath=%~dp1"
if "%~2" == "" (
set "datfile=%~nx1.dat"
) else (
set "datfile=%~nx2"
)
del "%~dp1%datfile%.bak" 2>nul
ren "%~dp1%datfile%" "%datfile%.bak" 2>nul
cd /d "%~dpnx1"
dat2.exe a -r "..\%datfile%" *
cd /d "%retdir%"
+24
View File
@@ -0,0 +1,24 @@
@echo off
set "retdir=%CD%"
if "%~1" == "" (
echo:
echo Usage: unpackdat filename [output_folder]
exit /b
)
if not exist "%~1" (
echo:
echo Error: DAT file not found
exit /b
)
if "%~2" == "" (
set "ofldr=%~n1"
) else (
set "ofldr=%~nx2"
)
cd /d "%~dp1"
dat2.exe x -d "%ofldr%" "%~nx1"
cd /d "%retdir%"