If WinExists("Setup") Then WinActivate("Setup") WinActivate("Welcome") Else Run("D:\Setup.exe", "D:\") EndIf WinWaitActive("Welcome") ControlClick("Welcome", "", "Button1") Sleep(2000) If WinExists("Question") Then ControlClick("Question", "", "Button2") EndIf WinWaitActive("Setup Complete") ControlCommand("Setup Complete", "", "Button2", "Check") ControlClick("Setup Complete", "", "Button4") Sleep(3000) If not WinExists("Welcome to the Office of Management and Budget CD-ROM!") Then Run("D:\welcome.pdf") WinWaitActive("Welcome to the Office of Management and Budget CD-ROM!") WinSetState("Welcome to the Office of Management and Budget CD-ROM!", "", @SW_MAXIMIZE) Else WinActivate("Welcome to the Office of Management and Budget CD-ROM!") EndIf