Re: script for Robocopy
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Fri, 23 May 2008 02:16:24 +0200
"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
.
- References:
- script for Robocopy
- From: Todd Hudson
- script for Robocopy
- Prev by Date: Re: Returning only a subset of groups in AD
- Next by Date: Re: Script DOS Command?
- Previous by thread: script for Robocopy
- Next by thread: Re: script for Robocopy
- Index(es):
Relevant Pages
|