File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments