OK I've been crunching through this for a week now and I finally think I'm getting somewhere. I want to uninstall a game using a vbscript and hopefully AutoIt can get me through the uninstall without any user interaction. My current code is...
What would be the most efficient way to loop this incase only 1 of the 4 games are installed? This was done solely with AutoIt. I plan to have the .exe stored on a mapped drive and initiate it through a .vbs script.
Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
Do not worry about asking questions here if it isn't a VBscript question, some but not all of us use AutoIT. But since it isn't a VBscript question, this will be moved to the other languages forum, or what ever it is called.
With that out of the way, one question I have is, since it seems that the window titles are the same, might there be text in the window that would be different? This way if your first send keys might have failed (i.e. sent to the wrong window) it will be certain to be on the correct window.
For example: (I only undated 1, and added DM's suggestion for using FileExists)
If you notice, I changed your winwaitactive to WinWait and then added a WinActivate. My reasons for this are: WinWaitActive waits for the window to become active, move to the front of everything) and if that never happens your script would hang. Using WinWait in it's place causes your script to wait till the window exists, does not have to be active, then it will activate the window and sendkeys to it. Additionally, using WinWait you should not need to sleep as much, so I lowered those times.
With all that said, I have not tested this and have not worked with the uninstall for the apps, so you would be better to tell if the above will work or not.
_____________________________
Mike
For useful Scripting links see the Read Me First stickey!
Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
Glad to help. One last thing, with AutoIT you can display a non-modal message to warn people not to mess with the mouse and keyboard while you do the uninstall. Take a look at SplashTextOn
_____________________________
Mike
For useful Scripting links see the Read Me First stickey!