DonkeyHottt Цитата: В Вашем коде заменил "Title" на название своего окна "Copy file (for non-reg users)"
Заменить то надо было, но не в самой же функции
Код: Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\...\2000.mdb"
WScript.Sleep 3000
WshShell.SendKeys "123"
WScript.Sleep 300
WshShell.SendKeys "{tab}"
WScript.Sleep 300
WshShell.SendKeys "456"
WScript.Sleep 300
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "{Enter}"
iActive = WinWaitActivate "Copy file (for non-reg users)", 5
If iActive = 1 Then WshShell.SendKeys("%{F4}")
Function WinWaitActivate(Title, TimeOut)
TimerInit = Timer
iRet = WshShell.AppActivate(Title)
While iRet = 0
Wscript.Sleep(10)
iRet = WshShell.AppActivate(Title)
If TimeOut > 0 And (Timer - TimerInit) >= TimeOut Then
WinWaitActivate = 0
Exit Function
End If
Wend
WinWaitActivate = 1
End Function