This script will display an explorer select dialogue that allows you to select the source folder and a destination folder.
The robocopy command will copy all files, regardless of path depth (yes, beyong 260 char limit), and will wait 999999 times with a wait period of 60 sec.
Code:
set "psCommand=powershell -Command "(new-object -COM 'Shell.Application')^
.BrowseForFolder(0,'Please choose a folder.',0,17).self.path""
for /f "usebackq delims=" %%s in (`%psCommand%`) do set "SrcDrv=%%s"
if "%SrcDrv:~3,1%"=="" (set SrcDrv=%SrcDrv:~0,-1%)
set "psCommand=powershell -Command "(new-object -COM 'Shell.Application')^
.BrowseForFolder(0,'Please choose a folder.',0,17).self.path""
for /f "usebackq delims=" %%d in (`%psCommand%`) do set "DestDrv=%%d"
if "%DestDrv:~3,1%"=="" (set DestDrv=%DestDrv:~0,-1%)
ROBOCOPY "%SrcDrv%" "%DestDrv%" /MIR /Z /R:999999 /W:60 /MT:8 /XD "$RECYCLE.BIN" "RECYCLER" "System Volume Information"
pause
I created this one for a problem my collegues ran into. We needed to recover some files from faulty drives that worked for 1 minute or two and then disconnected itself. Trying different SATA, USB to SATA adapters, nothing worked. So this would copy, hdd would disconnect, script would wait, hdd would reconnect, script would copy where it left off, and again.... and again... . I saved the department aprox. 2 days of work using this one. But no gratitude (as usual).
Bookmarks