Skip to content

Instantly share code, notes, and snippets.

@Jacob-Mango
Last active May 5, 2019 08:56
Show Gist options
  • Save Jacob-Mango/5df6ae6cf20e33ba17f7d976e12cd189 to your computer and use it in GitHub Desktop.
Save Jacob-Mango/5df6ae6cf20e33ba17f7d976e12cd189 to your computer and use it in GitHub Desktop.
@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  The following variables being used are 
echo  WorkDriveRoot: %WorkDriveRoot%
echo  ServerDirectory: %ServerDirectory%
echo  ClientDirectory: %ClientDirectory%
echo  WorkbenchDirectory: %WorkbenchDirectory%
:EchoLoopPrefixes
if defined ModPrefixDirectories[%Length%] (
REM call echo %%ModPrefixDirectories[%Length%]%%
set /a Length+=1
GOTO :EchoLoopPrefixes
)
set /a InclusiveLength=%Length%-1
echo  Mod Prefix Directories (total %Length%): 
for /l %%n in (0,1,%InclusiveLength%-1) do (
echo !ModPrefixDirectories[%%n]!
)
:PROMPT
SET /P AREYOUSURE= Are you sure you want to continue? (Y/[N]) 
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
echo  Setting up workbench symlinks 
rmdir "%WorkbenchDirectory%\Addons\"
mklink /J "%WorkbenchDirectory%\Addons\" "%ClientDirectory%\Addons\"
echo  Setting up server symlinks for unpacked DayZ (filepatching) 
echo Creating \dz\ link
rmdir "%ServerDirectory%\dz\"
mklink /J "%ServerDirectory%\dz\" "%WorkDriveRoot%dz\"
echo Creating \bin\ link
rmdir "%ServerDirectory%\bin\"
mklink /J "%ServerDirectory%\bin\" "%WorkDriveRoot%bin\"
echo Creating \core\ link
rmdir "%ServerDirectory%\core\"
mklink /J "%ServerDirectory%\core\" "%WorkDriveRoot%core\"
echo Creating \languagecore\ link
rmdir "%ServerDirectory%\languagecore\"
mklink /J "%ServerDirectory%\languagecore\" "%WorkDriveRoot%languagecore\"
echo Creating \gui\ link
rmdir "%ServerDirectory%\gui\"
mklink /J "%ServerDirectory%\gui\" "%WorkDriveRoot%gui\"
echo Creating \scripts\ link
rmdir "%ServerDirectory%\scripts\"
mklink /J "%ServerDirectory%\scripts\" "%WorkDriveRoot%scripts\"
echo Creating \system\ link
rmdir "%ServerDirectory%\system\"
mklink /J "%ServerDirectory%\system\" "%WorkDriveRoot%system\"
echo Creating \graphics\ link
rmdir "%ServerDirectory%\graphics\"
mklink /J "%ServerDirectory%\graphics\" "%WorkDriveRoot%graphics\"
echo  Setting up client symlinks for unpacked DayZ (filepatching) 
echo Creating \dz\ link
rmdir "%ClientDirectory%\dz\"
mklink /J "%ClientDirectory%\dz\" "%WorkDriveRoot%dz\"
echo Creating \bin\ link
rmdir "%ClientDirectory%\bin\"
mklink /J "%ClientDirectory%\bin\" "%WorkDriveRoot%bin\"
echo Creating \core\ link
rmdir "%ClientDirectory%\core\"
mklink /J "%ClientDirectory%\core\" "%WorkDriveRoot%core\"
echo Creating \languagecore\ link
rmdir "%ClientDirectory%\languagecore\"
mklink /J "%ClientDirectory%\languagecore\" "%WorkDriveRoot%languagecore\"
echo Creating \gui\ link
rmdir "%ClientDirectory%\gui\"
mklink /J "%ClientDirectory%\gui\" "%WorkDriveRoot%gui\"
echo Creating \scripts\ link
rmdir "%ClientDirectory%\scripts\"
mklink /J "%ClientDirectory%\scripts\" "%WorkDriveRoot%scripts\"
echo Creating \system\ link
rmdir "%ClientDirectory%\system\"
mklink /J "%ClientDirectory%\system\" "%WorkDriveRoot%system\"
echo Creating \graphics\ link
rmdir "%ClientDirectory%\graphics\"
mklink /J "%ClientDirectory%\graphics\" "%WorkDriveRoot%graphics\"
echo  Setting up the mods symbollic links for the server 
for /l %%n in (0,1,%InclusiveLength%-1) do (
echo Creating \!ModPrefixDirectories[%%n]!\ link
rmdir "%ServerDirectory%\!ModPrefixDirectories[%%n]!\"
mklink /J "%ServerDirectory%\!ModPrefixDirectories[%%n]!\" "%WorkDriveRoot%!ModPrefixDirectories[%%n]!\"\
)
echo  Setting up the mods symbollic links for the client 
for /l %%n in (0,1,%InclusiveLength%-1) do (
echo Creating \!ModPrefixDirectories[%%n]!\ link
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