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