'Bring the msgbox to the foreground.
WshShell.AppActivate "Defragmentace byla dokončena"
WScript.Sleep 200
'Send a tab key to move the focus from View Report button
'to the Close Button.
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
'Send key to Close the Defragmentation Complete window.
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
'Bring the application to the foreground.
WshShell.AppActivate "Defragmentace disku"
WScript.Sleep 200
'Move down to next drive
If firstjump = 0 Then WshShell.SendKeys "{TAB}{DOWN}"
firstjump = 1
Else: WshShell.SendKeys "{DOWN}"
End If
Next
'Send and ALT-F4 to Close the Defrag program.
If WshShell.AppActivate("Defragmentace disku") = True Then
WshShell.AppActivate "Defragmentace disku"
WshShell.SendKeys "%{F4}"
End If
'Send and ALT-F4 to Close the Defrag program.
If WshShell.AppActivate("Defragmentace disku") = True Then
WshShell.AppActivate "Defragmentace disku"
WshShell.SendKeys "%{F4}"
End If