Skip to content

Instantly share code, notes, and snippets.

@rkttu
Created June 16, 2022 06:18
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkttu/1ffe6aeb9208ac25750cb9816f514469 to your computer and use it in GitHub Desktop.
Save rkttu/1ffe6aeb9208ac25750cb9816f514469 to your computer and use it in GitHub Desktop.
Meet Internet Explorer Again 😏
Add-Type 'public class SFW { [System.Runtime.InteropServices.DllImport("user32.dll")][return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)] public static extern System.Boolean SetForegroundWindow(System.IntPtr hWnd); }'
$handle = [activator]::CreateInstance([type]::GetTypeFromCLSID("0002DF01-0000-0000-C000-000000000046"))
$handle.Visible = $true
$handle.Navigate('http://www.example.com/')
[SFW]::SetForegroundWindow($handle.HWND)
@rkttu
Copy link
Author

rkttu commented Jun 16, 2022

If you definitely want to part with IE...
https://docs.microsoft.com/en-us/deployedge/edge-ie-disable-ie11

@sople1
Copy link

sople1 commented Jun 16, 2022

image
(Windows 11)

WTF...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment