Like so:
Code: Select all
GetDrive, DriveList, List, REMOVABLE
For Drive in Drivelist { ;Not real code
FileCopy, *.png, %Drive%
FileCopy, *.jpg, %Drive%
}
MsgBox, Files Copied
Code: Select all
GetDrive, DriveList, List, REMOVABLE
For Drive in Drivelist { ;Not real code
FileCopy, *.png, %Drive%
FileCopy, *.jpg, %Drive%
}
MsgBox, Files Copied
Code: Select all
DriveGet, DriveList, List, REMOVABLE
drvList := StrSplit(DriveList)
For Drive in drvList {
FileCopy, *.png,% Drive ":\"
FileCopy, *.jpg,% Drive ":\"
}
MsgBox % "Files Copied"
Code: Select all
For driveNum, Drive in drvList {
Code: Select all
DriveGet, DriveList, List, REMOVABLE
Loop, Parse, DriveList {
FileCopy, *.png, %A_LoopField%
FileCopy, *.jpg, %A_LoopField%
}
Code: Select all
;- Copy Files on every USB-Drive
;- https://www.autohotkey.com/boards/viewtopic.php?f=76&t=81224
source1=%a_desktop%\TEST
DriveGet,a, List, REMOVABLE
loop,parse,A
{
x:=a_loopfield
drv=%x%:\
dest1=%drv%_BEELINK_TEST\DESKTOP\TEST
runwait,%comspec% /k robocopy "%source1%" "%dest1%" /XO /TEE /E /UNICODE *.jpg *.png
}
msgbox,COPY ENDED
exitapp
;=======================================================
Code: Select all
DriveGet, DriveList, List, REMOVABLE
Loop, Parse, DriveList
{
For extNum, ext in ["jpg", "png"]
FileCopy, % "*." ext, % A_LoopField ":\"
}
Code: Select all
source = E:\data\images
target = images
overwrite := False
; --------------------------
DriveGet, DriveList, List, REMOVABLE
stitle := "Copying files (Drives: " StrLen(DriveList) ")"
SplashTextOn, 300, 100, %stitle%, Please wait....
Loop, Parse, DriveList
{
SoundBeep, 1000, 20
ControlSetText, Static1, % "`nDrive #" A_Index " = " A_LoopField, %stitle%
dest = %A_LoopField%:\%target%
If !FileExist(dest)
FileCreateDir, %dest%
For extNum, ext in ["jpg", "png"]
FileCopy, % source "\*." ext, %dest%, %overwrite%
}
SplashTextOff
MsgBox, 64, Status, Done., 3
ExitApp