Add Wait! progress.
#NoTrayIcon
Opt("MustDeclareVars", 1)
Global $Source, $ssName, $Destin, $dsName, $btn, $pid
XcopyCommand()
Func XcopyCommand()
$Source = FileSelectFolder("Select drive or folder to copy", @DesktopDir, 2)
If Not $Source Then Exit
$ssName = FileGetShortName($Source, 1)
$Destin = FileSelectFolder("Select drive or folder to save", @DesktopDir, 1+2+4)
If Not $Destin Then Exit
$dsName = FileGetShortName($Destin, 1)
If @error Then Exit
$btn = MsgBox(36, "Copy confirm", "Do you wanted to copy?")
If $btn = 7 Then Exit
$pid = Run(@ComSpec & " /C"&' '&"Xcopy"&' '&$ssName&"\*.*"&' '&$dsName&" /S /E")
WinWaitActive("[Class:ConsoleWindowClass]", "", 1)
WinMove("[Class:ConsoleWindowClass]", "", 160, 180, 800, 400)
ProgressOn("", "", "", 330, 300)
Dim $i = 0
While ProcessExists($pid)
$i +=1
ProgressSet($i, "Please wait!", "Copying...")
If $i > 100 Then $i = 0
Sleep(100)
If ProcessExists($pid) = 0 Then
ProgressSet(100, "", "")
Sleep(500)
ExitLoop
EndIf
WEnd
ProgressOff()
MsgBox(64, "", "Completed")
EndFunc
#NoTrayIcon
Opt("MustDeclareVars", 1)
Global $Source, $ssName, $Destin, $dsName, $btn, $pid, $search, $files
XcopyCommand()
Func XcopyCommand()
$Source = FileSelectFolder("Select drive or folder to copy", @DesktopDir, 2)
If Not $Source Then Exit
$ssName = FileGetShortName($Source, 1)
$Destin = FileSelectFolder("Select drive or folder to save", @DesktopDir, 1+2+4)
If Not $Destin Then Exit
$dsName = FileGetShortName($Destin, 1)
If @error Then Exit
$btn = MsgBox(36, "Copy confirm", "Do you wanted to copy?")
If $btn = 7 Then Exit
Dim $oAutoIt
$oAutoIt = ObjCreate("AutoItX3.Control")
$pid = $oAutoIt.Run("cmd" & " /C"&' '&"Xcopy"&' '&$ssName&"\*.*"&' '&$dsName&" /S /E")
$oAutoIt.WinWaitActive("[Class:ConsoleWindowClass]", "", 1)
$oAutoIt.WinMove("[Class:ConsoleWindowClass]", "", 160, 180, 800, 400)
ProgressOn("", "", "", 330, 300)
Dim $i = 0
$search = FileFindFirstFile($Source&"\*.*")
While $oAutoIt.ProcessExists($pid)
$i +=1
$files = FileFindNextFile($search)
ProgressSet($i&$files, $files, "Copying...")
If $i > 100 Then $i = 0
Sleep(250)
If $oAutoIt.ProcessExists($pid) = 0 Then
ProgressSet(100, "", "")
Sleep(500)
ExitLoop
EndIf
WEnd
FileClose($search)
ProgressOff()
MsgBox(64, "", "Completed")
EndFunc