We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83b18e0 commit d2540e6Copy full SHA for d2540e6
win/nucleoFlasher/nucleoFlasher.bat
@@ -1,16 +1,9 @@
1
@ECHO off
2
-
3
SET SOURCE=%2
4
SET SRC_PARSE=%SOURCE:/=\%
5
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
+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)
0 commit comments