Last active
May 5, 2019 08:56
-
-
Save Jacob-Mango/5df6ae6cf20e33ba17f7d976e12cd189 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
REM Add more additional prefixes here! | |
set ModPrefixDirectories[0]=JM | |
set ModPrefixDirectories[1]=MyPrefix | |
REM Set the root of your workdrive here! | |
set WorkDriveRoot=P:\ | |
REM Set your dayz server, client and workbennch directories here! | |
set ServerDirectory=C:\Games\steamapps\common\DayZServer | |
set ClientDirectory=C:\Games\steamapps\common\DayZ | |
set WorkbenchDirectory=C:\Games\steamapps\common\DayZ Tools\Bin\Workbench | |
REM Don't touch the file after here unless you know what you are doing! | |
set /a Length=0 | |
set /a InclusiveLength=0 | |
echo [101;93m The following variables being used are [0m | |
echo [31m WorkDriveRoot:[0m %WorkDriveRoot% | |
echo [31m ServerDirectory:[0m %ServerDirectory% | |
echo [31m ClientDirectory:[0m %ClientDirectory% | |
echo [31m WorkbenchDirectory:[0m %WorkbenchDirectory% | |
:EchoLoopPrefixes | |
if defined ModPrefixDirectories[%Length%] ( | |
REM call echo %%ModPrefixDirectories[%Length%]%% | |
set /a Length+=1 | |
GOTO :EchoLoopPrefixes | |
) | |
set /a InclusiveLength=%Length%-1 | |
echo [31m Mod Prefix Directories (total %Length%): [0m | |
for /l %%n in (0,1,%InclusiveLength%-1) do ( | |
echo !ModPrefixDirectories[%%n]! | |
) | |
:PROMPT | |
SET /P AREYOUSURE=[101;93m Are you sure you want to continue? (Y/[N]) [0m | |
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END | |
echo [101;93m Setting up workbench symlinks [0m | |
rmdir "%WorkbenchDirectory%\Addons\" | |
mklink /J "%WorkbenchDirectory%\Addons\" "%ClientDirectory%\Addons\" | |
echo [101;93m Setting up server symlinks for unpacked DayZ (filepatching) [0m | |
echo [33mCreating \dz\ link[0m | |
rmdir "%ServerDirectory%\dz\" | |
mklink /J "%ServerDirectory%\dz\" "%WorkDriveRoot%dz\" | |
echo [33mCreating \bin\ link[0m | |
rmdir "%ServerDirectory%\bin\" | |
mklink /J "%ServerDirectory%\bin\" "%WorkDriveRoot%bin\" | |
echo [33mCreating \core\ link[0m | |
rmdir "%ServerDirectory%\core\" | |
mklink /J "%ServerDirectory%\core\" "%WorkDriveRoot%core\" | |
echo [33mCreating \languagecore\ link[0m | |
rmdir "%ServerDirectory%\languagecore\" | |
mklink /J "%ServerDirectory%\languagecore\" "%WorkDriveRoot%languagecore\" | |
echo [33mCreating \gui\ link[0m | |
rmdir "%ServerDirectory%\gui\" | |
mklink /J "%ServerDirectory%\gui\" "%WorkDriveRoot%gui\" | |
echo [33mCreating \scripts\ link[0m | |
rmdir "%ServerDirectory%\scripts\" | |
mklink /J "%ServerDirectory%\scripts\" "%WorkDriveRoot%scripts\" | |
echo [33mCreating \system\ link[0m | |
rmdir "%ServerDirectory%\system\" | |
mklink /J "%ServerDirectory%\system\" "%WorkDriveRoot%system\" | |
echo [33mCreating \graphics\ link[0m | |
rmdir "%ServerDirectory%\graphics\" | |
mklink /J "%ServerDirectory%\graphics\" "%WorkDriveRoot%graphics\" | |
echo [101;93m Setting up client symlinks for unpacked DayZ (filepatching) [0m | |
echo [33mCreating \dz\ link[0m | |
rmdir "%ClientDirectory%\dz\" | |
mklink /J "%ClientDirectory%\dz\" "%WorkDriveRoot%dz\" | |
echo [33mCreating \bin\ link[0m | |
rmdir "%ClientDirectory%\bin\" | |
mklink /J "%ClientDirectory%\bin\" "%WorkDriveRoot%bin\" | |
echo [33mCreating \core\ link[0m | |
rmdir "%ClientDirectory%\core\" | |
mklink /J "%ClientDirectory%\core\" "%WorkDriveRoot%core\" | |
echo [33mCreating \languagecore\ link[0m | |
rmdir "%ClientDirectory%\languagecore\" | |
mklink /J "%ClientDirectory%\languagecore\" "%WorkDriveRoot%languagecore\" | |
echo [33mCreating \gui\ link[0m | |
rmdir "%ClientDirectory%\gui\" | |
mklink /J "%ClientDirectory%\gui\" "%WorkDriveRoot%gui\" | |
echo [33mCreating \scripts\ link[0m | |
rmdir "%ClientDirectory%\scripts\" | |
mklink /J "%ClientDirectory%\scripts\" "%WorkDriveRoot%scripts\" | |
echo [33mCreating \system\ link[0m | |
rmdir "%ClientDirectory%\system\" | |
mklink /J "%ClientDirectory%\system\" "%WorkDriveRoot%system\" | |
echo [33mCreating \graphics\ link[0m | |
rmdir "%ClientDirectory%\graphics\" | |
mklink /J "%ClientDirectory%\graphics\" "%WorkDriveRoot%graphics\" | |
echo [101;93m Setting up the mods symbollic links for the server [0m | |
for /l %%n in (0,1,%InclusiveLength%-1) do ( | |
echo [33mCreating \!ModPrefixDirectories[%%n]!\ link[0m | |
rmdir "%ServerDirectory%\!ModPrefixDirectories[%%n]!\" | |
mklink /J "%ServerDirectory%\!ModPrefixDirectories[%%n]!\" "%WorkDriveRoot%!ModPrefixDirectories[%%n]!\"\ | |
) | |
echo [101;93m Setting up the mods symbollic links for the client [0m | |
for /l %%n in (0,1,%InclusiveLength%-1) do ( | |
echo [33mCreating \!ModPrefixDirectories[%%n]!\ link[0m | |
rmdir "%ClientDirectory%\!ModPrefixDirectories[%%n]!\" | |
mklink /J "%ClientDirectory%\!ModPrefixDirectories[%%n]!\" "%WorkDriveRoot%!ModPrefixDirectories[%%n]!\"\ | |
) | |
:END | |
endlocal | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment