Arduino_Tools/nucleoFlasher/nucleoFlasher.bat
Roger Clark bf2bb4cb76 Complete rewrite of NucleoFlasher.bat
Rewrote to use WMIC as the previous version didn't work on some machines, and also using WMIC is a much more elegant way to find the mass storage device (disk drive)
2016-10-02 13:58:48 +11:00

9 lines
434 B
Batchfile

@ECHO off
SET SOURCE=%2
SET SRC_PARSE=%SOURCE:/=\%
SET TARGET=%4
setlocal enabledelayedexpansion
for /F "skip=1 tokens=*" %%a in ('WMIC LOGICALDISK where "volumename like '%TARGET%%%'" get deviceid') do if not defined id set id=%%a
Call Set "deviceid=%%id: =%%"
if not "%deviceid%" == "" (XCOPY %SRC_PARSE% %deviceid% /Y /Q >NUL
echo Upload complete ) else ( echo %TARGET% not found. Please ensure the device is correctly connected)