You are not logged in.

#1 11 Jan 2020 11:03

NDog
Member
From: New Zealand
Registered: 31 May 2006
Posts: 121
Website

script to automate Epic Games Launcher games reinstall

Use this script to automate Epic Games Launcher games reinstall - from this video here - https://youtu.be/WiOyXTZ48rc

If you could improve this script please do...

Epic-Games-Updater.cmd

:: Epic-Games-Updater
:: ver 1.0 - http://youtube.com/ndog37
:: NB - robocopy command requires Windows 7 or greater


@echo off&cls
REM bcdedit>nul&if errorlevel 1 echo.&echo.&echo.&echo      Run as Administrator.&echo.&echo     That warn't no question.&echo.&echo.&echo.&echo.&echo.&pause&exit
title %~n0

:: variables
set _EpicInstalledPath=G:\Games\Epic Games
set _process=EpicGamesLauncher.exe
set _processDir=C:\Program Files (x86)\Epic Games\Launcher\Portal\Binaries\Win32

:: scan all folders - present a choice
echo Scanning for Games...
for /f "tokens=*" %%g in ('dir /b/ad/on "%_EpicInstalledPath%" 2^>nul') do (call :sub_menu "%%~ng")
:mainmenu
tasklist | find /i "%_process%" || start "" "%_processDir%\%_process%"
cls
set _choice=&set _gameDir=
echo      ---=== CHOSE A GAME TO REINSTALL ===---
echo.
:: get count
for /l %%g in (1,1,%_count%) do (call :sub_mainmenu "%%g")
echo.
set /p _choice=Choose a Game (q to quit): 
if "%_choice%" equ "" goto :mainmenu
if "%_choice%" equ "q" goto :end
if "%_choice%" gtr "0" if "%choice%" lss "%_count%" for /f "usebackq tokens=2-3* delims=_=" %%g in (`set _menu 2^>nul`) do (if %%g equ %_choice% set _gameDir=%%h)
if not defined _gameDir goto :mainmenu


:: prompt to reinstall game
cls
echo Selected Game --== %_gameDir% ==--
echo.
echo Open Epic Games Launcher and start reinstalling %_gameDir%
echo NB - It must be reinstalled under this Folder
echo %_EpicInstalledPath%
echo.
set /p _confirm=Do you wish to proceed (y to continue): 
if "%_confirm%" neq "y" goto :mainmenu
echo.
ren "%_EpicInstalledPath%\%_gameDir%" "%_gameDir%-reinstall"
echo Start reinstalling game in Epic Games Launcher now ^> Library
echo Wait until the game has installed at least 1%%
echo Then PAUSE then CANCEL the installer and continue this script ^> Downloads
echo.
pause
echo.

:: check the expected folder exists
:checkgamedirloop
if exist "%_EpicInstalledPath%\%_gameDir%" if exist "%_EpicInstalledPath%\%_gameDir%-reinstall" goto :overwritegamedir
ping localhost -n 7 >nul
goto :checkgamedirloop

:: overwrite folder
:overwritegamedir
REM robocopy /s /move "%_EpicInstalledPath%\%_gameDir%-reinstall" "%_EpicInstalledPath%\%_gameDir%"
rd /s/q "%_EpicInstalledPath%\%_gameDir%"
ren "%_EpicInstalledPath%\%_gameDir%-reinstall" "%_gameDir%"
echo.
echo Now resume the installation of %_gameDir%

:: prompt to reinstall another game
echo.
set /p _confirm=Do you want to reinstall another game? (y to continue): 
if "%_confirm%" equ "y" goto :mainmenu


:: end
echo.
pause&exit


:sub_menu
  set _called=%~1
  set /a _count+=1
  set _menu_%_count%=%_called%
  goto :eof

:sub_mainmenu
  call set _item=%%_menu_%~1%%
  echo %~1 - %_item%
  goto :eof

Please note saving the data in this location will ensure game appears to be installed on reloading system
C:\ProgramData\Epic


cmd, vbs, ps, bash
autoit, python, swift

Offline

Board footer

Powered by