Your content here
:: Prevent display of every line
@echo off
:: Necessary for variables to update in code
setlocal enableDelayedExpansion
:: Change execution directory to script location
cd /d %~dp0
:: Begin log
echo %DATE% %TIME% > cmd.log
echo EMMM2-windows.cmd >> cmd.log
:: Start the launcher
echo Start the launcher. >> cmd.log
call :Start_launcher
if !ERRORLEVEL! EQU 2 (
:: Launcher was unable to be started automatically
echo You are good to go!
pause
)
test.exe 2>> cmd.log
echo Start the launcher. >> cmd.log
call :Start_launcher
:Start_launcher
:: Minecraft can be installed in different locations
if exist "%programfiles(x86)%\Minecraft Launcher\MinecraftLauncher.exe" (
:: Do not wait
start "" "%programfiles(x86)%\Minecraft Launcher\MinecraftLauncher.exe"
EXIT /B 0
) else if exist "%programfiles(x86)%\Minecraft\MinecraftLauncher.exe" (
:: Do not wait
start "" "%programfiles(x86)%\Minecraft\MinecraftLauncher.exe"
EXIT /B 0
)
:: If Minecraft was installed through Microsoft Store, it cannot be started
EXIT /B 2
:Update
del "%appdata%\.minecraft\mods\*" /Q
:: Change execution directory to script location
cd /d %~dp0
curl -o mods.zip "%source%/mods.zip"
:: https://stackoverflow.com/questions/39290758/how-to-unzip-a-file-using-batch
:: Unzip commands needs directory to be created beforehand
if not exist "%appdata%\.minecraft\mods" (
mkdir %appdata%\.minecraft\mods
)
powershell.exe -nologo -noprofile -command "& { $shell = New-Object -COM Shell.Application; $target = $shell.NameSpace('%appdata%\.minecraft\mods'); $zip = $shell.NameSpace('%cd%\mods.zip'); $target.CopyHere($zip.Items(), 16); }"
:: copy "\\10.8.5.4\inventory\Games\Minecraft\Erics_Mine_Mod_Madness\mods\*" "%appdata%\.minecraft\mods\" 2>> cmd.log
exit /b 0
setlocal
set "psCommand="(new-object -COM 'Shell.Application')^
.BrowseForFolder(0,'Age of Ana Dizinini Nerde???',0,0).self.path""
IF NOT EXIST %APPDATA%\VAR_1.TXT (
for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "folder=%%I"
setlocal enabledelayedexpansion
echo !folder!>%APPDATA%\VAR_1.TXT
)
set /p Build=<%APPDATA%\VAR_1.txt
cd %Build%
for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set NetworkIP=%%a
age3y.exe +noIntroCinematics OverrideAddress="%NetworkIP%" hostPort=2301
endlocal
:: Inventory connection is required
:CheckInventory
echo Checking for Frinventory connection. >> cmd.log
if not exist "%inventory%" (
set c=y
set /p "c=Are you connected to the Frey Inventory? [Y|n]: "
if /i "!c!" == "y" (
goto CheckInventory
) else (
echo Cannot reach %inventory%
exit /b 1
)
)
echo Frinventory found. >> cmd.log
set "inventory=\10.8.5.4\inventory\Games\First Decade"
:: Mount CD
echo Mounting CnC The First Decade. >> cmd.log
call "%programfiles(x86)%\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" "%inventory%\CNCTFD.mdf" 2>> cmd.log