aaj007

Close running background application

5 posts in this topic

#1 ·  Posted

Hi there,

I will use BGINFO as INFO tool for our customer and the default /TASKBAR switch will not work because i am working with WMI Querys.

BGINFO is a little bit scrapy and this Bug is only with WMI Query, when it runs without them it´s fine but then i don´t need AUTOIT. :)

I start my AUTOIT BGINFO script as an scheduled task after 1 Min. when user has logged in and by some it runs fine and by others the BGINFO stands open in Background and that is not user likely.

Here my script:

$SCRIPT = "C:\ProgramData\SysinternalsSuite\BGInfo\Bginfo.exe C:\ProgramData\SysinternalsSuite\BGInfo\local.bgi /TASKBAR /SILENT /NOLICPROMPT"
Run ($SCRIPT)
$TITLE = "BGInfo"
WinWait($TITLE,"",5)
Call ("_Middle",$TITLE)
Sleep(500)
WinWaitActive($TITLE)
ControlSend($TITLE,"","","!{F4}")
 

I send an ALT F4 to the Program but when this application is open and another program is overlayed them it will not close or minimize to taskbar.

What can i do the Close the BGINFO in Background or when another Application is running over the Window of BGINFO?

with best regards.

André

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

@aaj007 look at ProcessClose in the help file.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

Sorry but this make no sense. I will not END the BGINFO.EXE, i will only minimize the running Window of the Application. 

ALT + F4 is pressing X in the Window and then BGINFO go to TASKBAR but this doesn´t work in Background of open Window.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Apologies, I saw ALT+F4 (not to mention your title Close background application) and thought you were trying to close the process. If the window is visible as you state, you can grab the information with the AutoIt Window Info Tool (in the same directory where you installed AutoIt), and then use WinSetState to minimize it. If this does not minimize it to the task bar (haven't used BGINFO in years), you can still grab the window and then use ControlSend to send your ALT+F4. ControlSend sends to that particular window, whether it is on top or not.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted

This works for me:

If ProcessExists("BGInfo.exe") Then Exit
Run("C:\BGInfo\bginfo.exe C:\BGInfo\Client.bgi /TASKBAR /NOLICPROMPT /SILENT")
WinWait("BGInfo", "", 4)
ControlSend("BGInfo","","","!{F4}")

 

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