Copy latest nucleoflasher to Win specific folder

This commit is contained in:
Roger Clark 2016-11-14 10:08:56 +11:00
parent 83b18e0b76
commit d2540e6ff5

View file

@ -1,16 +1,9 @@
@ECHO off @ECHO off
SET SOURCE=%2 SET SOURCE=%2
SET SRC_PARSE=%SOURCE:/=\% SET SRC_PARSE=%SOURCE:/=\%
SET TARGET=%4 SET TARGET=%4
setlocal enabledelayedexpansion
FOR %%I IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO ( for /F "skip=1 tokens=*" %%a in ('WMIC LOGICALDISK where "volumename like '%TARGET%%%'" get deviceid') do if not defined id set id=%%a
VOL %%I: 2>NUL | FIND "%TARGET%" >NUL && SET DEST=%%I: 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)
IF DEFINED DEST (
XCOPY %SRC_PARSE% %DEST% /Y /Q >NUL
) ELSE (
ECHO %TARGET% not found. Please ensure the device is correctly connected
EXIT /B 1
)