Trigger batch script via registry upon opening internet explorer

  1. Posts : 1

    Trigger batch script via registry upon opening internet explorer

    Anyone knows how can i trigger a script (which deletes registry keys) when a user tries to open internet explorer?
    I tried modifying the HKCU\Software\Microsoft\Internet Explorer\Main\RunOnceComplete key but that prompts the user for approval each time in order for the script to run.
    Basically I'm trying to automatically delete the registry keys which redirect to edge after Microsoft disabled IE.
    We have it as a part of our logon scripts, but somtimes the key is created again after logon and then the user needs to log-off and logon again, which I'm trying to solve.
      My Computer

  2. Posts : 754
    Windows 10/11

    If I'm understanding correctly, you want to allow users to continue to use IE. If that's right, you could create a shortcut for them that launches IE via a VBS script. That way, you won't have to bother with those registry values.

    SampleCode/LaunchIE.vbs at main . LesFerch/SampleCode . GitHub

    Otherwise, you could leave a script running that deletes that key on some interval (maybe once a minute) but nobody likes solutions like that. Or give the user a shortcut they can run to delete the key (but then you might as well just make that a shortcut to launch IE). I don't know if you can trigger a script to run on an attempt to run IE. I doubt it.
      My Computer

  3. Posts : 1,241
    Windows 10

    I have not tried this because i don't use IE or Edge but there looks to be some policies you can configure to stop the prompts. Well they look like they will stop the redirects but you would have to try i cannot say for certain because i have not tried it.
      My Computer

  4. Posts : 17,012
    Windows 10 Home x64 Version 22H2 Build 19045.4170

    You could
    - delete their IE shortcuts
    - replace them with shortcuts to a batch / PS / VBS script that uses reg commands to do what you want and only then runs a command to open IE.
    - - There's no reason to expect reg commands o prompt any kind of confirmation dialog within HKCU\Software\Microsoft\Internet Explorer\Main

    I do not have a Key called HKCU\Software\Microsoft\Internet Explorer\Main\RunOnceComplete
    If it has some permission on it that forces the user confirmation that you mentioned then set the script up to run elevated in Task scheduler and then give the users shortcuts that run that TS task instead.
    - There'd be no Admin prompt at the point of use.
    - The user shortcuts would be in the form schtasks.exe /Run /TN "IEStartupStuff"
    Create Elevated App Shortcut without Admin Prompt - TenForumsTutorials

    Best of luck,
      My Computer

  5. Posts : 826
    Windows 7

    The correct method is blocking the IEToEdge BHO (Browser Helper Object), via local policy.
    This reg file will prevent the BHO from installing itself on new user accounts, and disable it on existing user profiles.

    Based on my testing:
    - For existing users that already have the redirect, applying the reg unblocks IE11 the next time it's run.

    - For new users, IE11 will open normally. If you don't change the default Start Page, MSN's landing page will nag you three different times to upgrade but you can dismiss those tabs. Setting the Start Page to about:blank avoids this problem entirely.
    Trigger batch script via registry upon opening internet explorer Attached Files
      My Computer

  6. Posts : 1,679

    Internet Explorer in the 21st century?
    Perhaps it's time to move to a modern browser?
      My Computer


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 02:56.
Find Us

Windows 10 Forums