Colored Menu for starting multi task [SOLVED]
Posted: 17 Apr 2012 03:49
i'm making a batch file to install manual update to an online game so i'm missing one thing,
how can i ask to input to the location of a folder that has that update patches
This is the final Code and working fine Problem solved
how can i ask to input to the location of a folder that has that update patches
This is the final Code and working fine Problem solved
Code: Select all
@echo off
Title Fiesta Manual Update Installer V3.0
::======================================================================
SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a"
)
::======================================================================
mode 60,30
color 0
echo:&echo:&echo:&echo:&echo:&echo:&echo:&echo:&echo:&echo:
echo: ######## #### ######## ###### ######## ###
echo: ## ## ## ## ## ## ## ##
echo: ## ## ## ## ## ## ##
echo: ###### ## ###### ###### ## ## ##
echo: ## ## ## ## ## #########
echo: ## ## ## ## ## ## ## ##
echo: ## #### ######## ###### ## ## ##
echo:&echo:&echo:&echo:&echo:&echo:
call :color 0f " Enter "
pause >nul
cls
color 07
::======================================================================
:loop1
echo:&echo:&echo:&echo:&echo:
call :color 07 " ==================================" &echo:
call :color 07 " =" & call :color 0d "Fiesta Manual Update Installer" & call :color 07 "=" & echo:
call :color 07 " ==================================" &echo:&echo:
call :color 0f " Select An Option" &echo:&echo:&echo:
call :color 0a " (1) Auto Install" &echo:&echo:
call :color 0b " (2) Install Patches" &echo:&echo:
call :color 0e " (3) Install Sharplaunchers" &echo:&echo:
call :color 08 " (4) Exit" &echo:&echo:&echo:
set /p "cho1=Option #"
if %errorlevel%==1 cls & goto loop1
if %cho1%==1 goto auto
if %cho1%==2 goto patches
if %cho1%==3 goto sharplaunchers
if %cho1%==4 goto EOF
echo Invalid choice.
cls
goto loop1
::======================================================================
:auto
echo:
call :color 0c "Enter sharp launchers and patches Directory "&echo:
set /p "installpath=Dir:>"
if %errorlevel%==1 cls & goto loop1
call :color 04 "Installing Sharplaunchers and Patches ..."&echo:
if exist "%temp%\log.log" del /F /Q "%temp%\log.log" >nul
ping localhost -n 2 >nul
setlocal enableextensions
set log=%temp%\log.log
for /f "tokens=*" %%c in ('dir /b /on "%installpath%\*.*"') do (
echo %installpath%\%%c >>"%log%"
)
for /f "tokens=*" %%d in (%log%) do (
start "" /w "%%d"
)
msg * Auto Installation Completed.
msg * Please Restart Your Computer so Changes can take Effect.
cls
goto loop1
::======================================================================
:sharplaunchers
echo:
call :color 0c "Enter sharplaunchers Directory "&echo:
set /p "installpath=Dir:>"
if %errorlevel%==1 cls & goto loop1
call :color 04 "Installing Sharplaunchers ..."&echo:
if exist "%temp%\log.log" del /F /Q "%temp%\log.log" >nul
ping localhost -n 2 >nul
setlocal enableextensions
set log=%temp%\log.log
for /f "tokens=*" %%c in ('dir /b /on "%installpath%\*.*"') do (
echo %installpath%\%%c >>"%log%"
)
for /f "tokens=*" %%d in (%log%) do (
start "" /w "%%d"
)
msg * SharpLaunchers Installation Completed.
msg * Please Restart Your Computer so Changes can take Effect.
cls
goto loop1
::======================================================================
:patches
echo:
call :color 0c "Enter patches Directory "&echo:
set /p "installpath=Dir:>"
if %errorlevel%==1 cls & goto loop1
call :color 04 "Installing Patches ..."&echo:
if exist "%temp%\log.log" del /F /Q "%temp%\log.log" >nul
ping localhost -n 2 >nul
setlocal enableextensions
set log=%temp%\log.log
for /f "tokens=*" %%c in ('dir /b /on "%installpath%\*.*"') do (
echo %installpath%\%%c >>"%log%"
)
for /f "tokens=*" %%d in (%log%) do (
start "" /w "%%d"
)
msg * Patches Installation Completed.
cls
goto loop1
::======================================================================
:color
echo off
<nul set /p ".="%DEL% " " >> "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1
goto :eof
::======================================================================