bonerdose: this part of the .bat file is causing the issue, maybe you can review it tomorrow when you start over # Write flash-all.bat cat > tmp/$PRODUCT-$VERSION/flash-all.bat << EOF @ECHO OFF :: Copyright 2012 The Android Open Source Project :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. PATH=%PATH%;"%SYSTEMROOT%\System32" :: Detect Fastboot version with inline PowerShell :: Should work with Windows 7 and later @PowerShell ^ \$version=fastboot --version; ^ try { ^ \$verNum = \$version[0].substring(17, 6); ^ \$verNum = \$verNum.replace('.', ''); ^ if ((-Not (\$verNum -gt 2802)) -Or (-Not (\$verNum -match '^[\d.]+$'))) { ^ Exit 1 ^ } ^ } catch { ^ Exit 1 ^ } IF %ERRORLEVEL% NEQ 0 ( ECHO fastboot too old; please download the latest version at https://developer.android.com/studio/releases/platform-tools.html EXIT /B )