Sign in to follow this  
Followers 0
ChipConnJohn

Cannot get Window to close

3 posts in this topic

Hello all,

I'm trying to get a script to work and having no success.

I'm trying to script a Ninite exe such that my AutoIt script launches the file, then closes the Ninite window when it's finished.

(For those not familiar, Ninite is a killer installation tool. You choose what programs you want from Ninite.com and it gives you one exe that installs them all.)

My trouble is that I cannot get AutoIt to close the window no matter what I try. Here's what I tried:

TRY 1:
$success = winClose("Ninite")
ConsoleWrite("WinClose returned a "& $success)
-- It returns a 1, but the window remains.

TRY 2:
If WinExists("Ninite") Then
msgbox(0,"Ninite win exists","It's there")
WinActivate("Ninite")
Send("!{F4}")
EndIf
-- This works for other programs like "AutoIt Help" and "Calculator".  When I put "Ninite" in the WinExists() returns True but the Alt-F4 doesn't do anything.

TRY 3:
$PID = ProcessExists("Ninite.exe")
If $PID Then
$result = ProcessCLose($PID)
  msgbox(0,"Result","Result = "& $result)
EndIf
-- Again, ProcessExists returns True and the $result of ProcessClose returns a 1, but the window stays open.

TRY 4:
;There is a Close button in the window that I attempted to press with ControlClick.
WinActivate("Ninite")  ; I see the Ninite window activate
$result = ControlClick("Ninite", "", "[ID:2]")
msgbox(0,"result is","Result is "& $result) ; $result = 1 as though it closed it pressed the "Close" control, but window remains open.

This is really frustrating. Anyone know of another way I can close this window?

Thanks,

-ChipConnJohn

Share this post


Link to post
Share on other sites



In silent mode you will not see any windows : NiniteInstaller.exe /silent :)


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Hi Wakillon,

Yeah, I know about the /silent switch. However, what I'm trying to achieve is a system that tells me when an install or update fail by scraping the text of the window.

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