Sign in to follow this  
Followers 0
Alex Lau

Paused on the first window ! Help me !

4 posts in this topic

#1 ·  Posted (edited)

hi ,

can anyone help to check my script below ? it's always paused on the first window when i run it , i don't know what's happened, i have ran many test for this script , sometime succesfully and sometimes failed.

i don't know what can i do.

----------------------------------------------------------------------

$answer = MsgBox(64+4, "SAP GUI Upgrade", "This program will upgrade SAP GUI from 6.20 to 6.40. do you want to do it now ?")

If $answer = 7 Then

Exit

EndIf

RunAsSet("Administrator", "xxxxx", "xxxxxx")

RunWait("\\172.16.16.39\mis\source\sapgui640\setup.exe")

WinWaitActive("SAP Front-End Configuration Wizard - [step 1 of 2]")

;The script pasued on the window above , but when i run the script again, it will pass, and there two AutoIt icons in the system icon area!!!

Send("{Enter}")

WinWaitActive("SAP Front-End Configuration Wizard - [step 2 of 2]")

Send("{Enter}")

WinWaitActive("SAP Front-End Setup Wizard")

Send("{Enter}")

RunAsSet()

$answer = msgbox(0, "SAP GUI Upgrade", "Completed!")

------------------------------------------------------------------------

Thank you very much !!!

post-18144-1164079693_thumb.jpg

Edited by Alex Lau

Share this post


Link to post
Share on other sites



hi ,

can anyone help to check my script below ? it's always paused on the first window when i run it , i don't know what's happened, i have ran many test for this script , sometime succesfully and sometimes failed.

i don't know what can i do.

----------------------------------------------------------------------

$answer = MsgBox(64+4, "SAP GUI Upgrade", "This program will upgrade SAP GUI from 6.20 to 6.40. do you want to do it now ?")

If $answer = 7 Then

Exit

EndIf

RunAsSet("Administrator", "xxxxx", "xxxxxx")

RunWait("\\172.16.16.39\mis\source\sapgui640\setup.exe")

WinWaitActive("SAP Front-End Configuration Wizard - [step 1 of 2]")

;The script pasued on the window above , but when i run the script again, it will pass, and there two AutoIt icons in the system icon area!!!

Send("{Enter}")

WinWaitActive("SAP Front-End Configuration Wizard - [step 2 of 2]")

Send("{Enter}")

WinWaitActive("SAP Front-End Setup Wizard")

Send("{Enter}")

RunAsSet()

$answer = msgbox(0, "SAP GUI Upgrade", "Completed!")

------------------------------------------------------------------------

Thank you very much !!!

about the "2 tray icons" problem i know i need add "#NoTrayIcon" in the first line ;)

Share this post


Link to post
Share on other sites

If you want your script to continue while the setup is running, then you need to use Run(). I added window activation as well.

$answer = MsgBox(64 + 4, "SAP GUI Upgrade", "This program will upgrade SAP GUI from 6.20 to 6.40. do you want to do it now ?")
If $answer = 7 Then
    Exit
EndIf

RunAsSet("Administrator", "xxxxx", "xxxxxx")

$pid = Run("\\172.16.16.39\mis\source\sapgui640\setup.exe")

WinWait("SAP Front-End Configuration Wizard - [Step 1 of 2]")
If Not WinActive("SAP Front-End Configuration Wizard - [Step 1 of 2]") Then
    WinActivate("SAP Front-End Configuration Wizard - [Step 1 of 2]")
EndIf
WinWaitActive("SAP Front-End Configuration Wizard - [Step 1 of 2]")
Send("{Enter}")

WinWait("SAP Front-End Configuration Wizard - [Step 2 of 2]")
If Not WinActive("SAP Front-End Configuration Wizard - [Step 2 of 2]") Then
    WinActivate("SAP Front-End Configuration Wizard - [Step 2 of 2]")
EndIf
WinWaitActive("SAP Front-End Configuration Wizard - [Step 2 of 2]")
Send("{Enter}")

WinWait("SAP Front-End Setup Wizard")
If Not WinActive("SAP Front-End Setup Wizard") Then
    WinActivate("SAP Front-End Setup Wizard")
EndIf
WinWaitActive("SAP Front-End Setup Wizard")
Send("{Enter}")

ProcessWaitClose($pid)

RunAsSet()

MsgBox(0, "SAP GUI Upgrade", "Completed!")

;)

Share this post


Link to post
Share on other sites

If you want your script to continue while the setup is running, then you need to use Run(). I added window activation as well.

$answer = MsgBox(64 + 4, "SAP GUI Upgrade", "This program will upgrade SAP GUI from 6.20 to 6.40. do you want to do it now ?")
If $answer = 7 Then
    Exit
EndIf

RunAsSet("Administrator", "xxxxx", "xxxxxx")

$pid = Run("\\172.16.16.39\mis\source\sapgui640\setup.exe")

WinWait("SAP Front-End Configuration Wizard - [Step 1 of 2]")
If Not WinActive("SAP Front-End Configuration Wizard - [Step 1 of 2]") Then
    WinActivate("SAP Front-End Configuration Wizard - [Step 1 of 2]")
EndIf
WinWaitActive("SAP Front-End Configuration Wizard - [Step 1 of 2]")
Send("{Enter}")

WinWait("SAP Front-End Configuration Wizard - [Step 2 of 2]")
If Not WinActive("SAP Front-End Configuration Wizard - [Step 2 of 2]") Then
    WinActivate("SAP Front-End Configuration Wizard - [Step 2 of 2]")
EndIf
WinWaitActive("SAP Front-End Configuration Wizard - [Step 2 of 2]")
Send("{Enter}")

WinWait("SAP Front-End Setup Wizard")
If Not WinActive("SAP Front-End Setup Wizard") Then
    WinActivate("SAP Front-End Setup Wizard")
EndIf
WinWaitActive("SAP Front-End Setup Wizard")
Send("{Enter}")

ProcessWaitClose($pid)

RunAsSet()

MsgBox(0, "SAP GUI Upgrade", "Completed!")

;)

working perfection !! Thank you very much ! :lmao::evil:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0