Sleep(5000) If WinExists("Software License Agreement") Then ControlClick("Software License Agreement", "", "Button2") EndIf ShellExecute("D:\Start.pdf") WinWaitActive("Start.pdf") WinSetState("Start.pdf", "", @SW_MAXIMIZE)