File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change 11@ ECHO off
2-
32SET SOURCE = %2
43SET SRC_PARSE = %SOURCE:/ =\ %
54SET 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)
You can’t perform that action at this time.
0 commit comments