This is a small Bat script i made when trying to copy files to my Removeable drive from a specific folder, in this case i use C:\tmp\ to copy the files onto my Removeable drive.
Copy and paste this code into a text file and rename it to USBcopy.bat
When run you will get options to start the copy process.

ECHO OFF
CLS
:MENU
ECHO.
ECHO ———————————————————————-
ECHO Copy files to SD/USB
ECHO ———————————————————————-
ECHO PRESS 1 to copy your Update files
ECHO Update Files MUST be located in C:\tmp\
ECHO ———————————————————————-
ECHO 1 – Begin the Copy Process
ECHO 2 – EXIT
SET /P M=Type 1 or 2 and press ENTER:
IF %M%==1 GOTO SINGLE
IF %M%==2 GOTO EOF
:SINGLE
@ECHO OFF
:prompt
setlocal enabledelayedexpansion
set drive=
echo:
for /f “usebackq tokens=1*” %%a in (`fsutil fsinfo drives ^| find “:”`) do (
if /i “%%a” NEQ “Drives:” (
set “drive=%%a”
) ELSE (
set “drive=%%b”
)
set drive=!drive:\=!
for %%D in (!drive!) do (
set label=
for /f “usebackq tokens=1* delims=\- ” %%A in (`fsutil fsinfo drivetype %%D`) do (
for /f “usebackq tokens=5*” %%U in (`vol %%A 2^>nul ^| findstr “^.Volume.in.drive…is” ^| findstr /v “^.Volume.Serial”`) do set label=%%V
set type=%%B
)
set “label=!label! ”
set type=!type:~0,-1!
for /f “usebackq tokens=2*” %%R in (`subst 2^>nul ^| findstr /i /b “%%D”`) do set type=SUBST : %%S
echo:%%D [!label:~0,32!] !type!
)
)
ECHO ———————————————————————-
ECHO Select the USB Drive Letter
ECHO ———————————————————————-
set /p “driveletter=Drive letter: ”
set driveletter=%driveletter:~0,1%:
if not exist %driveletter% (
echo Drive %driveletter% is not available.
pause
exit /b
)
ECHO Start Copying files?
pause
xcopy C:\tmp\*.* %driveletter%\ /e
ECHO ———————————————————————
ECHO Copy FINISHED!
ECHO ———————————————————————-
pause

Enjoy

Be Sociable, Share!

Comments are closed.

Search
Sponsor


Page Rank