Skip to content

chore: replace xcpy usage by busybox cp #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions win/massStorageCopy.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
@echo off

rem Exit codes for xcopy
rem code | Description
rem 0 | Files were copied without error.
rem 1 | No files were found to copy.
rem 2 | The user pressed CTRL+C to terminate xcopy.
rem 4 | Initialization error occurred. There is not enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line.
rem 5 | Disk write error occurred.

set SOURCE=%2
set SRC_PARSE=%SOURCE:/=\%
set TARGET=%4
Expand Down Expand Up @@ -43,7 +35,7 @@ setlocal enabledelayedexpansion
for /F "skip=1 tokens=*" %%a in ('WMIC LOGICALDISK where "volumename like '%~1'" get deviceid 2^>NUL') do if not defined id set id=%%a
call set "deviceid=%%id: =%%"
if not "%deviceid%" == "" (
XCOPY %SRC_PARSE% %deviceid% /Y /Q
%~dp0busybox.exe cp -f %SRC_PARSE% %deviceid%
if !errorlevel! == 0 (echo Upload complete on %1 ^(%deviceid%^))
exit !errorlevel!)
goto :eof