Arduino_Tools/win/massStorageCopy.bat

10 lines
433 B
Batchfile
Raw Normal View History

2016-09-16 10:39:24 +00:00
@ECHO off
SET SOURCE=%2
SET SRC_PARSE=%SOURCE:/=\%
SET TARGET=%4
2016-11-13 22:26:47 +00:00
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)