@Echo off
Echo ############################################################
Echo ##                                                        ##
Echo ##                   SymLink Installer                    ##
Echo ##                                                        ##
Echo ##                      !ATTENTION!                       ##
Echo ##                                                        ##
Echo ##  THIS CMD FILE CREATES A SYMLINKS FROM THE FOLDER /C/  ##
Echo ##      !Edit VST   paths in this file, if necessary!     ##
Echo ##                                                        ##
Echo ############################################################
chcp 861>nul

:: BatchGotAdmin BEGIN https://sites.google.com/site/eneerge/home/BatchGotAdmin | https://ss64.com/nt/rem.html | https://ss64.com/nt/cacls.html
:: Check for permissions
mkdir "%windir%\GotAdminTestCreateDir"
if '%errorlevel%' == '0' (
    rmdir "%windir%\GotAdminTestCreateDir" &goto gotAdmin
) else ( goto UACPrompt )




:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%~dp0getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%~dp0getadmin.vbs"

    "%~dp0getadmin.vbs"
    exit /B

:gotAdmin
    if exist "%~dp0getadmin.vbs" ( del "%~dp0getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
:: BatchGotAdmin END

:: x86? BEGIN
Set xOS=x64& If "%PROCESSOR_ARCHITECTURE%"=="x86" (
If Not Defined PROCESSOR_ARCHITEW6432 Set xOS=x86
)
Echo OS - %xOS%
If "%xOS%"=="x86" (
  goto x86Windows
) Else (
  goto x64Windows
)
:: x86? END

GOTO START_POINT
:: Source Directories Structure BEGIN

:: Source Directories Structure END
:START_POINT

:x64Windows
:: x64 Windows BEGIN

cmd /c mkdir "%COMMONPROGRAMFILES%\VST3\iZotope"
cmd /c mklink /j "%COMMONPROGRAMFILES%\VST3\iZotope\Stutter Edit" "%~dp0C\Program Files\Common Files\VST3\iZotope\Stutter Edit"
cmd /c mkdir "%PROGRAMFILES%\iZotope"
cmd /c mklink /j "%PROGRAMFILES%\iZotope\Stutter Edit 2" "%~dp0C\Program Files\iZotope\Stutter Edit 2"
cmd /c mkdir "%PROGRAMFILES(x86)%\iZotope"
cmd /c mklink /j "%PROGRAMFILES(x86)%\iZotope\Stutter Edit" "%~dp0C\Program Files (x86)\iZotope\Stutter Edit"
cmd /c mkdir "%PROGRAMDATA%\iZotope"
cmd /c mklink /j "%PROGRAMDATA%\iZotope\Stutter Edit" "%~dp0C\ProgramData\iZotope\Stutter Edit"

CD /d "%~dp0"
:: [[[OPTIONAL: IT IS A PLACE FOR ADDITIONAL x64 Windows COMMANDS]]]
CALL regedit.exe -s "Reg\1.reg"
:: x64 Windows END
goto OUT

:x86Windows
:: x86 Windows BEGIN

CD /d "%~dp0"
:: [[[OPTIONAL: IT IS A PLACE FOR ADDITIONAL x86 Windows COMMANDS]]]

:: x86 Windows END
goto OUT

:OUT
PAUSE
EXIT

