Jump to content

Stop specific website from launching

Recommended Posts

@Danp2. If that would have been the case, I wouldn't have posted here :) 

What if there are other sites opened which are important and should not be closed.


@JLogan3o13, application is installed through EXE but uninstalled via MSI. So when I run the below command with the keyname, it uninstalls and then launches the sites.

RunWait(@ComSpec & ' /c MsiExec.exe /X{keyname} /qn', "", @SW_HIDE)


Link to post
Share on other sites

This is a function I've used in the past to retrieve the active tab in IE --

; Function Name:    _IEGetActiveTab()
; Description:      Retrieve the IE Window Object of the currently active tab
; Parameter(s):     None
; Requirement(s):   AutoIt3 V3.2 or higher
;                   On Success  - Returns an object variable pointing to the IE Window Object
;                   On Failure  - Returns 0 and sets @ERROR
;                   @ERROR      - 0 ($_IEStatus_Success) = No Error
;                               - 7 ($_IEStatus_NoMatch) = No Match
; Author(s):        Dan Pollak
Func _IEGetActiveTab()
Local $hwnd, $i, $title, $oIE

    ; get first IE instance
    $oIE = _IEAttach ("", "instance", 1)

    If @error = $_IESTATUS_Success Then
        ; get window title
        $hwnd = _IEPropertyGet($oIE, "hwnd")
        $title = WinGetTitle($hwnd)

        ;strip off trailing browser text
        $i = StringInStr($title, ' - ', 0, -1)
        If $i > 0 Then
            $title = StringLeft($title, $i - 1)

        $oIE = _IEAttach($title, "windowtitle")

    Return $oIE

You could use this as-is or you could use it as the basis for a function that loops through all tabs and kills any where the title matches a given list.

Link to post
Share on other sites
  • Moderators

I misunderstood your OP, I thought you were just planning to install this and had caught the behavior on uninstall through testing. In that case I would have suggested simply opening the MSI (hidden in the exe wrapper) with ORCA and removing the custom action to open the web page on uninstall. But it sounds like this was missed before installation and you are beyond that point.

More of an overall question, which may also lend itself to your issue, is why you're doing uninstalls during the middle of the day when the users are working? Why not follow best practice and do them overnight, using whatever tool (SCCM, Altiris, etc.) to inform the users there will be the need for a reboot? That would alleviate the problem of seeing the browser window pop up (not to mention a periodic reboot has been shown to cut support calls by a pretty hefty margin in general).

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

You can still do the process of keeping browsers closed.

Just start the script with a wait so that it does not force kill a browser if its open but instead waits until any pre-existing instances of a browser are closed and then runs the script.

Your other options are to build your own uninstaller :) 

While 1
    If ProcessExists("iexplore.exe") Then


;Uninstall Script

Func _KeepBrowsersClosed()
    If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe")

Tweak, add your other browsers, etc.

Possibly have it run at login so it completes before users even get a chance to open a browser. 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...