Sign in to follow this  
Followers 0
prpldodge

Winwait does not seem to work

11 posts in this topic

Have a simple script that call the uninstall routine for Novell. it requires two user inputs (hit enter) to complete. I captured the windows title and added some text that is displayed but it just ignores the windows and the user still has to hit enter. Any help would be appreciated. here is the script

RunWait('cmd /c "%SystemRoot%\system32\rundll32 nwsetup.dll NWUninstallClient"')

WinWait("Uninstall Novell Client for Windows","Are you sure you wan")

If Not WinActive("Uninstall Novell Client for Windows","Are you sure you wan") Then WinActivate("Uninstall Novell Client for Windows","Are you sure you wan")

WinWaitActive("Uninstall Novell Client for Windows","Are you sure you wan")

Send("{ENTER}")

WinWait("Uninstall Novell Client for Windows","you must shut down")

If Not WinActive("Uninstall Novell Client for Windows","you must shut down") Then WinActivate("Uninstall Novell Client for Windows","you must shut down")

WinWaitActive("Uninstall Novell Client for Windows","you must shut down")

Send("{ENTER}")

Thanks

Alan

Share this post


Link to post
Share on other sites



Have a simple script that call the uninstall routine for Novell. it requires two user inputs (hit enter) to complete. I captured the windows title and added some text that is displayed but it just ignores the windows and the user still has to hit enter. Any help would be appreciated. here is the script

RunWait('cmd /c "%SystemRoot%\system32\rundll32 nwsetup.dll NWUninstallClient"')

WinWait("Uninstall Novell Client for Windows","Are you sure you wan")

If Not WinActive("Uninstall Novell Client for Windows","Are you sure you wan") Then WinActivate("Uninstall Novell Client for Windows","Are you sure you wan")

WinWaitActive("Uninstall Novell Client for Windows","Are you sure you wan")

Send("{ENTER}")

WinWait("Uninstall Novell Client for Windows","you must shut down")

If Not WinActive("Uninstall Novell Client for Windows","you must shut down") Then WinActivate("Uninstall Novell Client for Windows","you must shut down")

WinWaitActive("Uninstall Novell Client for Windows","you must shut down")

Send("{ENTER}")

Thanks

Alan

The text is case sensitive. Examine the windows with AU3Info.exe to be sure you are matching visible text, and you have a case-sensitive match. Also, if there is only one window with that title, you don't need the text at all.

muttley


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

The second winactive needed the y in "you" capitalized but after recompiling I get the same thing. The two windows have the same name for a title. It only seems to run the

RunWait('cmd /c "%SystemRoot%\system32\rundll32 nwsetup.dll NWUninstallClient"') and ignores the rest.

Puzzled

Alan

Share this post


Link to post
Share on other sites

The second winactive needed the y in "you" capitalized but after recompiling I get the same thing. The two windows have the same name for a title. It only seems to run the

RunWait('cmd /c "%SystemRoot%\system32\rundll32 nwsetup.dll NWUninstallClient"') and ignores the rest.

Puzzled

Alan

Post the summary tab from AU3Info.exe with the mouse on the button you want (hit Ctrl-Alt-f to freeze the window info tool).

muttley


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

...after recompiling...

Don't compile it while debugging. Run it as an AU3 text file and include this line at the very top of your code:
AutoItSetOption("TrayIconDebug", 1)  ;0-off
then mouse-over the AutoIt icon in the system tray to see exatly whitch line of code the script is hung on - if any.

...It only seems to run the

RunWait('cmd /c "%SystemRoot%\system32\rundll32 nwsetup.dll NWUninstallClient"') and ignores the rest...

Does the script hang or exit? I'm ging to guess hangs - maybe you want Run instead of RunWait.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Ok I am working on postinng the summary tabs. but I was wondering if the problem is the runwait command. In the help it says "Runs an external program and pauses script execution until the program finishes." That is what is seems to be doing is pausing the script and not sending the enter key. is there a better way of executing that line?

Alan

Edited by prpldodge

Share this post


Link to post
Share on other sites

$wTtl = "Uninstall Novell Client for Windows"
RunWait(@SystemDir & "\rundll32 nwsetup.dll NWUninstallClient")
WinWaitActive($wTtl)
Send("{ENTER}")
Sleep(100)
WinWaitActive($wTtl)
Send("{ENTER}")


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Ok I am working on postinng the summary tabs. but I was wondering if the problem is the runwait command. In the help it says "Runs an external program and pauses script execution until the program finishes." That is what is seems to be doing is pausing the script and not sending the enter key. is there a better way of executing that line?

Alan

That's what herewasplato posted:

Does the script hang or exit? I'm ging to guess hangs - maybe you want Run instead of RunWait.

muttley


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

George

Your code did the same thing but, I took PsaltyDS suggestion and changed the RunWait to Run and then your code worked fine. My guess is the original code might have worked but I like the way you did it. A lot cleaner looking. So just like the help file said "Runs an external program and pauses script execution until the program finishes" is what was happening. The script was waiting for it end before going on.

Thanks all for the help.

Alan

Share this post


Link to post
Share on other sites

George

Your code did the same thing but, I took PsaltyDS suggestion and changed the RunWait to Run and then your code worked fine. My guess is the original code might have worked but I like the way you did it. A lot cleaner looking. So just like the help file said "Runs an external program and pauses script execution until the program finishes" is what was happening. The script was waiting for it end before going on.

Thanks all for the help.

Alan

I forgot to change that in my code. Oh well, as long as it works then you should be fine.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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