JBeardNC

Preventing App (IE) from opening

6 posts in this topic

When I'm updating Flash or Java for example, I am closing IE for the user beforehand and IE must remain closed as to not interfere with the install. I'd like to see if there is a (better) way to prevent them from opening IE during the middle of the update. Currently, I launch a separate process/script that simply does a While loop and every 50 ms, it checks for IE using WinExists and if it finds it, kills the process. But what ends up happening is if it closes the process at the right moment, the user will get a message that looks like a permissions error or an error like the IE shortcut doesn't exist and prompts the user to remove the shortcut and its causing some confusion. It may be because I have the 50 ms interval too small but I wanted to reach out and see if there is a better way to block an application from opening temporarily while something finishes, in this case, block IE while Java or Flash install completes. I tried using If ProcessExists and got the same results. Here's the script I'm using. Any better ideas? I just need to block IE from opening for about 30 seconds. If it has a notification (like the toast pop-up I added), that's even better but its not required. 

#include <toast.au3>

$sMsg  = "Adobe Flash is being updated on your computer." & @CRLF & @CRLF & "Internet Explorer will open once the update is complete."

sleep (2000)

While ProcessExists ("AdobeFlashUpdate.exe")
    sleep(50)
    If WinExists ("Internet Explorer") Then
        WinClose ("Internet Explorer")
        OpenToast()
    EndIf
WEnd

Func OpenToast()

    _Toast_Set(5, 0xFFFF33, 0x000000, 0xCC0000, 0xFFFFFF, 10)
    $aRet = _Toast_Show(0, "Please wait...", $sMsg, 10, False)
    ;_Toast_Hide()

EndFunc

Run ("C:\Program Files (x86)\Internet Explorer\iexplore.exe")

Exit

Share this post


Link to post
Share on other sites



Hi.

A group policy setting could be used to temporary disallow starting iexplore.exe:

gpedit.exe

- Computer configuration

-- windows settings

--- security settings

---- software restriction policies --> new software restricion policies

 

activate prior you launch your upate, remove afterwards.

 

Users will receive a message like "your admin disallowed ..."

 

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

Thanks for the idea but that won't work. It only needs to prevent it from opening for around 30-40 seconds while Flash or Java install. Plus, I don't want the user to receive any error message. If anything, I'd like for them to just see a message that another application is installing and IE will open when its complete.

Share this post


Link to post
Share on other sites

BlockInput might also be an option to think about.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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

  • Similar Content

    • kawliga751
      By kawliga751
      I have a workplace GUI that has a search field function that pulls up customer records to allow changes. I am attempting to 1)LOGIN 2)Enter Search field, enter a number and then {ENTER} 3)change specific field once customer record loads. I have very limited experience in GUI manipulation but I am able to login using the below:
      #include <IE.au3> Const $navOpenInNewTab = 0x0800 Dim $oIE = _IECreate('http://asag.xxxxxxx.com/ASAG/index.htm') Call ("RacksheetSignIn") Func RacksheetSignIn () Local $username = _IEGetObjByName ($oIE,"uname") Local $password = _IEGetObjByName ($oIE,"pword") $oIE.Navigate2('http://asag.xxxxxxx.com/apps/RackSheets/LogInSAG/login.asp',2048) _IEFormElementSetValue ($username, "xxxxxxx") _IEFormElementSetValue ($password, "xxxxxxx") Send('{Enter}') EndFunc However I can't seem to use the _IEGetObjByName or Mouseclick to focus on the search field to allow me to enter my search criteria. When I "inspect element" in the Search field I get the attached:
       
      Any help would be MUCH appreciated
       
       
       

    • TotalAuto
      By TotalAuto
      Hi All
      I am new to AutoIT, its community, and pretty much programming in general. 
      After a bit of online research, I decided to focus on AutoIT as my first programming attempt as it seems quite powerful and amazing once you become advanced at it. I have read some introductory pdfs which where good, including from the guy I think who invented it. I also watched various sketchy youtube videos, checked out the forum etc. I have to admit it's a bit confusing starting off but I reckon if I just keep pushing forward with continual hard work I can only get better.  
      My first AutoIT project has been to open Internet Explorer and automatically log into Twitter to save doing it manually. I plan to run this after windows start up via task scheduler. I am using the #include <IE.au3> UDF but for some reason about 20% of the time I receive the following orange error notifications at the bottom of the editor (pic attached). When it happens the IE browser just doesn't open but the program continues to run which mucks up the script. 
      Does anyone know why this is happening and how it can be fixed? Also is there some other better, less error prone way, to open IE and automatically log in?
      I have tried to use the Get Object NAME and ID commands to insert the username and password (i.e. the xxxxxxxxxx's) but when I right click to use "Inspect element" there is no name or id. It seems to be some sort of java script reference?
      I am using Windows 7 with latest updates and Internet Explorer version 11.
      As this is my first post I hope I am following protocols, and if not, please let me know and I will improve.
      Thanks

    • ur
      By ur
      For the below form, I am able to automate using below code for textboxes.

      #include <IE.au3> Local $oIE = _IEAttach("http://localhost:18170/MartAdmin/", "url") _IELoadWait($oIE) $Search = _IEGetObjById($oIE,"x-auto-16-input") _IEPropertySet($Search, 'innerText','Uday KIran') $Search = _IEGetObjById($oIE,"x-auto-18-input") _IEPropertySet($Search, 'innerText','Uday KIran') But for the Login button, there is no id or name.
      The html code when I click on Inspect element in browser, shown below.
      <button tabindex="0" class="x-btn-text" style="width: 64px; position: relative;" type="button">Log In</button> Please let me know how to click this.?
       
    • Arlen
      By Arlen
      I'm doing a script to login and check my grades for college and some other useful things. But how can I check if i'm already logged in.
      What I have tried is to _IEDocReadHTML and then try to read the string with my username or anything that indicates I am logged. But it never returns the actually real html that I am seeing on my browser. It only returned a logged out html version. Anyway I can find out when I am logged or not. Thanks.
    • Hanukka
      By Hanukka
      Hi guys, 
      I was trying to automate a webpage after getting input from excel. The script worked fine for like 5 iterations but then stopped all of a sudden, I dont have the exact error msg now, but it was pointing to this in the IE UDF:-
      Return SetError($_IESTATUS_Success, $oTemp.GetElementsByTagName($sTagName).length,
      When i looked up the forum there was a similar question which said that I have to fix KB 3008923 update by uninstalling it, but I am unable to do that. 
      here is the link for download:- ( i guess )
      https://support.microsoft.com/en-us/help/3024777/error-0x800706f7-occurs-after-you-install-kb-3004394-and-then-run-windows-update-in-windows-7-and-windows-server-2008-r2
      Does anybody know the proper steps to solve this??
      Plus I wont be able to send the code here because of privacy policy n all by the company.
      Desperately looking for a reply.....