echo off
REM SET ENABLEEXTENSIONS
rem SETLOCAL EnabledDelayedExpansion

SET CHOSEN_NVM_VERSION=%1
ECHO Bin file to update is: %CHOSEN_NVM_VERSION%

echo .
ECHO Making sure QV driver is installed..
call uninstall.bat
pause
call install.bat /y

echo .
echo Inventory of devices:
echo .....
nvmupdatew64e.exe -i -l

echo .
rem echo Replace NVM version to chosen..
powershell.exe -command "(gc config_i225.txt) -replace 'NVM_VERSION','%CHOSEN_NVM_VERSION%' | Out-File -encoding ASCII config_i225.txt"

echo .
echo .....Updating.....
nvmupdatew64e.exe -u -l -c config_i225.txt

powershell.exe -command "(gc config_i225.txt) -replace '%CHOSEN_NVM_VERSION%','NVM_VERSION' | Out-File -encoding ASCII config_i225.txt"
