Sign in to follow this  
Followers 0
DarkBoost

Google Chrome - Launch and Close

4 posts in this topic

Hello, I have written a script which launches a portable version of the Google Chrome Browser which it does fine however it launches a whole range of "chrome.exe" (see attachment). I could just use a "ProcessClose" in a While Loop until it's closed however if I had already an instance of Google Chrome running (which in many cases I will) it would close ALL of them. I would just like to close the instance which the script launched.

I am not sure how to do this and looking for some help please :)

 

 

google_chrome.jpg

Share this post


Link to post
Share on other sites



Hi @DarkBoost

First you should deactivate the background chrome process that keep running after closed (https://support.google.com/chrome/answer/1184722?hl=en). Then, when you launch chrome get its hWnd and simple do a WinClose($hWnd). This way you will close that specific windows and the processes that is bound to it. Try and let me know if this work for you.

Share this post


Link to post
Share on other sites

@MichaelHB

Thanks for replying, this option 'deactivate the background chrome process' was already disabled and something which I am not sure if I would like to replicate on other users machines as they may wish to have this feature activated. What I did end up doing was to capture all the existing Chrome.exe Process ID's (if any) before launching Chrome and then collect all the Process ID's after to figure out which ones were specific to me. Then I had the ability to close them.

Thanks,

Share this post


Link to post
Share on other sites

Glad that you solve it. :)

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