Copy latest nucleoflasher to Win specific folder
This commit is contained in:
parent
83b18e0b76
commit
d2540e6ff5
1 changed files with 5 additions and 12 deletions
|
|
@ -1,16 +1,9 @@
|
|||
@ECHO off
|
||||
|
||||
SET SOURCE=%2
|
||||
SET SRC_PARSE=%SOURCE:/=\%
|
||||
SET TARGET=%4
|
||||
|
||||
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 (
|
||||
VOL %%I: 2>NUL | FIND "%TARGET%" >NUL && SET DEST=%%I:
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
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)
|
||||
Loading…
Reference in a new issue