-1

i made it to loop through the dives on my computer and when ever a usb is in the drive it copies it to a folder? but when ever i run it, it doesn't work whats wrong?

@echo off
cls
:loop
xcopy /S E:\ D:\Users\nic\Desktop\Stuff\Usb >nul 
cls
xcopy /S F:\ D:\Users\nic\Desktop\Stuff\Usb >nul
cls
xcopy /S H:\ D:\Users\nic\Desktop\Stuff\Usb >nul
cls
xcopy /S I:\ D:\Users\nic\Usb 
timeout 10
goto loop
David M
  • 71,481
  • 13
  • 158
  • 186
Hamish Mckie
  • 17
  • 1
  • 1
  • 5

2 Answers2

1

Have you tried removing the >nul to see if you're hiding informative messages like it waiting for a drive to be inserted?

David M
  • 71,481
  • 13
  • 158
  • 186
0

Try this instead

@echo off
:loop
xcopy /E E:\ D:\Users\nic\Desktop\Stuff\Usb >nul 
xcopy /E F:\ D:\Users\nic\Desktop\Stuff\Usb >nul
xcopy /E H:\ D:\Users\nic\Desktop\Stuff\Usb >nul
xcopy /E I:\ D:\Users\nic\Usb 
timeout /t 10
goto :loop
Bali C
  • 30,582
  • 35
  • 123
  • 152