Hello,
I've seen dozens of examples on how to copy folders with a progress bar. But find that I don't want to incorporate the code in my very simple/tiny scripts.
Anyhow, I have come up with this bit of code.
I would like to know what the risks/danger of using such code. I can only come up with is there is no error checking if the folder copied or not.
But I would image there or more risks I can't possible come up with.
I welcome any advice/help.
Thanks.
I've seen dozens of examples on how to copy folders with a progress bar. But find that I don't want to incorporate the code in my very simple/tiny scripts.
Anyhow, I have come up with this bit of code.
[ autoit ]
$sSourceFolder = "D:\!Drivers" $iSourceSize = DirGetSize($sSourceFolder) $sDestFolder = @DesktopDir & "\" & "TestDownloadFolder" Run(@AutoItExe & ' /AutoIt3ExecuteLine "DirCopy(''' & $sSourceFolder & ''', ''' & $sDestFolder & ''')"') ProgressOn("Progress Meter", "Increments every second", "0 percent") Do $iDestSize = DirGetSize($sDestFolder) $iPercent = Int($iDestSize / ($iSourceSize / 100)) ProgressSet($iPercent, $iPercent & " percent") Until $iPercent = 100 ProgressSet(100 , "Done", "Complete") Sleep(500) ProgressOff()
I would like to know what the risks/danger of using such code. I can only come up with is there is no error checking if the folder copied or not.
But I would image there or more risks I can't possible come up with.
I welcome any advice/help.
Thanks.