I've got a simple batch file which i've set to run as a scheduled task to copy over our Veeam backups to an external HDD which can then be changed every day for backups.
I've got a bit of software called RemoveDrive.exe which should initiate a safe removal of the the USB drive however it doesnt seem to be working when it is in my batch file. It works on its own if I set up a separate batch file and just run it, however when it is a line in my other batch file at the end it doesn't trigger it.
Below is the complete batch file that I've set up.....
Can anyone see any problems with it? The RemoveDrive.exe is in the same folder as the batch file so should run and the batch file still runs perfectly fine up until the removedrive line. Just wanted to make it a nice all in one batch file that would disconnect the USB drive so I can just go in the server room and swap drives without having to log on and go into My Computer and go to 'Safely Remove'.
I've got a bit of software called RemoveDrive.exe which should initiate a safe removal of the the USB drive however it doesnt seem to be working when it is in my batch file. It works on its own if I set up a separate batch file and just run it, however when it is a line in my other batch file at the end it doesn't trigger it.
Below is the complete batch file that I've set up.....
ECHO Y | DEL g:*.* /s /q
xcopy E:\Backups G:\ /E /Y /R /H
removedrive G: -L -W:1000
Can anyone see any problems with it? The RemoveDrive.exe is in the same folder as the batch file so should run and the batch file still runs perfectly fine up until the removedrive line. Just wanted to make it a nice all in one batch file that would disconnect the USB drive so I can just go in the server room and swap drives without having to log on and go into My Computer and go to 'Safely Remove'.
Last edited: