Chuck U Posted April 6, 2006 Posted April 6, 2006 Hello. I am having some issues with my code. Can someone help? Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient") If WinWaitActive("RUNDLL", "loading NWSETUP") Then Send("{ENTER}") Else WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client") Send("{ENTER}") WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes") Send("!y") WinWaitActive("NMAS Client Components", "has been successfully uninstalled") Send("{ENTER}") WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer") Send("!n") EndIf Everything seems to compile ok in SciTE but for whatever reason, everything past Else does not work. When my script is the following..... Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient") WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client") Send("{ENTER}") WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes") Send("!y") WinWaitActive("NMAS Client Components", "has been successfully uninstalled") Send("{ENTER}") WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer") Send("!n") ..... everything seems to work ok. Help?
BigDod Posted April 6, 2006 Posted April 6, 2006 Surely in this line If WinWaitActive("RUNDLL", "loading NWSETUP") Then you should be checking for the return value from WinWaitActive. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
Chuck U Posted April 6, 2006 Author Posted April 6, 2006 Surely in this line If WinWaitActive("RUNDLL", "loading NWSETUP") Then you should be checking for the return value from WinWaitActive. I am a newbie.... .... What do you mean?
Valuater Posted April 6, 2006 Posted April 6, 2006 If WinWaitActive("RUNDLL", "loading NWSETUP") =1 Then 8)
Moderators SmOke_N Posted April 6, 2006 Moderators Posted April 6, 2006 (edited) I don't think that makes much sense... All that is going to do is wait until it becomes true anyway. Wouldn't you need to timeout or use If WinActive()? Edited April 6, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Chuck U Posted April 6, 2006 Author Posted April 6, 2006 Thanks for that info, but that did not seem to fix this issue.... I think it may have something to do with the Else. This is the section of code that does not run.... Else WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client") Send("{ENTER}") WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes") Send("!y") WinWaitActive("NMAS Client Components", "has been successfully uninstalled") Send("{ENTER}") WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer") Send("!n") EndIf
Moderators SmOke_N Posted April 6, 2006 Moderators Posted April 6, 2006 Thanks for that info, but that did not seem to fix this issue.... I think it may have something to do with the Else. This is the section of code that does not run.... Else WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client") Send("{ENTER}") WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes") Send("!y") WinWaitActive("NMAS Client Components", "has been successfully uninstalled") Send("{ENTER}") WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer") Send("!n") EndIfAs I stated, there is no time out on any of your WinWaits... so the titles / text may be wrong, and it's not carrying through to the next part, because that window is never actually active, so it's still wating. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Valuater Posted April 6, 2006 Posted April 6, 2006 I don't think that makes much sense... All that is going to do is wait until it becomes true anyway. Wouldn't you need to timeout or use If WinActive()?i didn't read the whole post... i just responded to BigDod and...I am a newbie.... .... What do you mean?8)BTW... you are right
Moderators SmOke_N Posted April 6, 2006 Moderators Posted April 6, 2006 WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")Doesn't look right? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
jackyyll Posted April 6, 2006 Posted April 6, 2006 (edited) Uhh..This WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")Should be thisWinWaitActive("NMAS Client Components", "remove NMAS Client Components")And, WinWaitActive pauses the script until the window is active, so you shouldnt have to check if its true do you? Edited April 6, 2006 by jackyyll
Valuater Posted April 6, 2006 Posted April 6, 2006 WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")Doesn't look right? SmOke is correct... however now that i have read your post ( as i should have at first) once the window is active ("RUNDLL", "loading NWSETUP") your program will use the send() command and it DOES NOT enter the "Else" statement example $Value = 1 If $Value = 1 Then MsgBox('', '', "The value is 1 ") Else MsgBox('', '', "The value is not 1 ") EndIf the else above is never entered... unless you chage the value.. like this $Value = 0 If $Value = 1 Then MsgBox('', '', "The value is 1 ") Else MsgBox('', '', "The value is not 1 ") EndIf hope that helps 8)
Chuck U Posted April 6, 2006 Author Posted April 6, 2006 I have figured it out.... Here is the info.... Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient") If WinWaitActive("RUNDLL", "loading NWSETUP", 3) = 1 Then Send("{ENTER}") Exit EndIf If WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client") = 1 Then Send("{ENTER}") WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes") Send("!y") WinWaitActive("NMAS Client Components", "has been successfully uninstalled") Send("{ENTER}") WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer") Send("!n") EndIf Thanks for the ideas. -Chuck
Moderators SmOke_N Posted April 6, 2006 Moderators Posted April 6, 2006 This:WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")Is still not correct, the 3rd parameter "&Yes", is how long to wait to time out, not what button to wait for. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Valuater Posted April 6, 2006 Posted April 6, 2006 This:WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes")Is still not correct, the 3rd parameter "&Yes", is how long to wait to time out, not what button to wait for. i guess as a value it equals "0", but its still not correct 8)
Moderators SmOke_N Posted April 6, 2006 Moderators Posted April 6, 2006 i guess as a value it equals "0", but its still not correct8)I don't know if it equals '0', I think I remember CyberSlug had said something previously about the strings actually retaining a numeric value... but I can't remember where that was, maybe it was the idea lab or bug reports. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Andrew J Posted April 7, 2006 Posted April 7, 2006 There are easier commandline ways to remove the Novell client, have a look athttp://support.novell.com/cgi-bin/search/s...i?/10070072.htmhttp://www.novell.com/support/search.do?cm...0%200%201364777ie RUNDLL32.EXE NWSETUP.DLL NWUninstallClientHowever, this approach results in one additional prompt ("Are you sure you want to...") in addition to the NMAS concern described above. Much easier to script that what you were upto before
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now