Skip to content

Commit d2540e6

Browse files
Copy latest nucleoflasher to Win specific folder
1 parent 83b18e0 commit d2540e6

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

win/nucleoFlasher/nucleoFlasher.bat

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
@ECHO off
2-
32
SET SOURCE=%2
43
SET SRC_PARSE=%SOURCE:/=\%
54
SET TARGET=%4
6-
7-
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 (
8-
VOL %%I: 2>NUL | FIND "%TARGET%" >NUL && SET DEST=%%I:
9-
)
10-
11-
IF DEFINED DEST (
12-
XCOPY %SRC_PARSE% %DEST% /Y /Q >NUL
13-
) ELSE (
14-
ECHO %TARGET% not found. Please ensure the device is correctly connected
15-
EXIT /B 1
16-
)
5+
setlocal enabledelayedexpansion
6+
for /F "skip=1 tokens=*" %%a in ('WMIC LOGICALDISK where "volumename like '%TARGET%%%'" get deviceid') do if not defined id set id=%%a
7+
Call Set "deviceid=%%id: =%%"
8+
if not "%deviceid%" == "" (XCOPY %SRC_PARSE% %deviceid% /Y /Q >NUL
9+
echo Upload complete ) else ( echo %TARGET% not found. Please ensure the device is correctly connected)

0 commit comments

Comments
 (0)