1. Home
  2. Docs
  3. MOBILE HARDWARE
  4. Android general features
  5. Batch Files Quick Reference Guide

Batch Files Quick Reference Guide

Conditional structure

if %WIFI_CONNECTED% EQU 1 (goto MDM_JOIGNABLE)

 

Select menu

echo.
echo SELECTION DU NIVEAU DE MISE A JOUR
echo 1 - OS ADB
echo 2 - OS OTA
echo 3 - INSTALLER MASTER
echo 4 - QUITTER
echo.
set choix=
:question0
echo.
set /p choix=Saisir le numero de votre choix (1,2,3 ou 4) :
if /I "%choix%"=="1" (goto :OS)
if /I "%choix%"=="2" (goto :OSOTA)
if /I "%choix%"=="3" (goto :MASTER)
if /I "%choix%"=="4" (goto :FIN)
goto question0

 

GOTO (call specific program points)

Goto 

 

Search/replace file on PC

copy /Y .\2-Applications\config.ini .\6-PERSO\%serial%config.ini
powershell -Command "(gc .\6-PERSO\%serial%Config.ini) -replace 'USER01', '%nom% - %serial%' | Out-File .\6-PERSO\%serial%Config.ini" -encoding ASCII

 

Close all windows in memory

REM nettoyage des stack en cours
for /F "tokens=1,2,3,4" %%i in ('%adb% shell "am stack list | grep \"Stack id\" "') do (
call :idstackcleaner "%%j" 
)
:idstackcleaner
set id=%~1
set id2=%id:~3%
if %id2% NEQ 0 (
%adb% shell am stack remove %id2%
)
goto :eof