Skip to content

Commit 28eee9b

Browse files
committed
Add update.bat
1 parent 996721d commit 28eee9b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

update.bat

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
rem Prompt the user for the target directory containing replacement files
5+
set /p "sourceDirectory=Enter the path to the directory Unturned Managed directory to update files: "
6+
7+
rem Set the destination directory where the files will be replaced
8+
set "destinationDirectory=.\redist"
9+
10+
rem Ensure the destination directory exists
11+
if not exist "%destinationDirectory%" (
12+
echo Destination directory does not exist.
13+
exit /b 1
14+
)
15+
16+
rem Loop through all files in the source directory
17+
for %%F in ("%sourceDirectory%\*.*") do (
18+
rem Check if the file exists in the destination directory
19+
if exist "%destinationDirectory%\%%~nxF" (
20+
rem Replace the file in the destination directory
21+
copy /y "%%F" "%destinationDirectory%"
22+
echo %%~nxF replaced.
23+
) else (
24+
echo %%~nxF does not exist in the destination directory.
25+
)
26+
)
27+
28+
echo Replacement completed.
29+
exit /b 0

0 commit comments

Comments
 (0)