Re: script for Robocopy




"Todd Hudson" <tatung70@xxxxxxxxxxx> wrote in message
news:uMAf8OGvIHA.5288@xxxxxxxxxxxxxxxxxxxxxxx
I have a requirement to have data backed up from multiple external USB
devices to a single USB device.

All of the USB devices are named the same except for the target.

What I am looking for is a simple script to copy data from all external
drives to a single external drive. The query could be to:

Look for drive named Target. Then copy all data from source path to target
path on all external drives except for the one named Target.

Willing pay pay via PayPal if you can help with this.

Thanks

If you don't watch out then you might get killed in the stampede
for your PayPal fee . . .

This is a fairly simple job that several respondents are likely to
respond to, free of charge. Here is one solution as a starting point.

01. Const USB = 2
02. Set WshShell = CreateObject("WScript.Shell")
03. Set objSWbemServices = GetObject("winmgmts:\\.")
04. Set colSWbemObjectSet =
objSWbemServices.InstancesOf("Win32_LogicalDisk")
05.
06. sDriveLetters = ""
07. For Each objSWbemObject In colSWbemObjectSet
08. If objSWbemObject.DriveType = USB Then
09. If UCase(objSWbemObject.VolumeName) = "TARGET" _
10. Then sTargetLetter = objSWbemObject.DeviceID _
11. Else sDriveLetters = sDriveLetters & objSWbemObject.DeviceID & " "
12. End If
13. Next
14. aDriveLetters = Split(sDriveLetters, " ")
15.
16. For i = 0 To UBound(aDriveLetters) - 1
17. command = "robocopy.exe /r:1 /w:1 /s " & aDriveLetters(i) & "\ " _
18. & sTargetLetter & "\Drive" & Left(aDriveLetters(i), 1) & " *.*"
19. WshShell.Run command, 1, True
20. Next


.



Relevant Pages

  • Re: script for Robocopy
    ... devices to a single USB device. ... All of the USB devices are named the same except for the target. ... path on all external drives except for the one named Target. ...
    (microsoft.public.scripting.vbscript)
  • Re: help with usb probs
    ... previously saved documents cannot be opened form Word either. ... icons either, even if it's one of those sessions when the device ... but not the external drives. ... I tried that and am getting 'unrecognised usb device' ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Tool to inspect the SMART infos of USB harddiscs (not only of IDEs)
    ... >>likely not work on external drives unless the USB interface was ... The reason that the USB hard disks don't ... a USB device makes the disk speak ... > good enough to satisfy using the disk as a storage device, ...
    (comp.sys.ibm.pc.hardware.storage)
  • Re: Recognizing an external drive when rebooting
    ... that should restore from one of my external drives to my C drive. ... It should but I have seen some machines that hang if certain USB ... it's related to some motherboard or USB device incompatibility. ... Try connecting the USB devices after, ...
    (microsoft.public.windowsxp.general)