Stopping Brower From Opening when Exe Launches

I am launching a game using powershell for my arcade cabinet, the script works just how I want, but the program “XArcade_XInput.exe” opens the browser whenever it is opened. Is there a way to add something to this script to either have the browser window not show up, like a “Hide UI” like you can do with a bat, or a way to at least have it open minimized and close when exit the script, like how the script closes “XArcade_XInput” at the same time it closes MK11.

# FORCE Window to Focus
function Show-Window {
    [string] $ProcessName

  # As a courtesy, strip '.exe' from the name, if present.
  $ProcessName = $ProcessName -replace '\.exe$'

  # Get the PID of the first instance of a process with the given name
  # that has a non-empty window title.
  # NOTE: If multiple instances have visible windows, it is undefined
  #       which one is returned.
  $hWnd = (Get-Process -ErrorAction Ignore $ProcessName).Where({ $_.MainWindowTitle }, 'First').MainWindowHandle

  if (-not $hWnd) { Throw "No $ProcessName process with a non-empty window title found." }

  $type = Add-Type -PassThru -NameSpace Util -Name SetFgWin -MemberDefinition @'
    [DllImport("user32.dll", SetLastError=true)]
    public static extern bool SetForegroundWindow(IntPtr hWnd);
    [DllImport("user32.dll", SetLastError=true)]
    public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);    
    [DllImport("user32.dll", SetLastError=true)]
    public static extern bool IsIconic(IntPtr hWnd);    // Is the window minimized?

  # Note: 
  #  * This can still fail, because the window could have bee closed since
  #    the title was obtained.
  #  * If the target window is currently minimized, it gets the *focus*, but its
  #    *not restored*.
  $null = $type::SetForegroundWindow($hWnd)
  # If the window is minimized, restore it.
  # Note: We don't call ShowWindow() *unconditionally*, because doing so would
  #       restore a currently *maximized* window instead of activating it in its current state.
  if ($type::IsIconic($hwnd)) {
    $type::ShowWindow($hwnd, 9) # SW_RESTORE


# Hide PowerShell Console
Add-Type -Name Window -Namespace Console -MemberDefinition '
public static extern IntPtr GetConsoleWindow();
public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow);
$consolePtr = [Console.Window]::GetConsoleWindow()
[Console.Window]::ShowWindow($consolePtr, 0)

$EXEFile="D:\Games\Mortal Kombat 11\Binaries\Retail\MK11.exe"


$EXEBaseName=Get-ChildItem $EXEFile
# Gets the simple name of the EXE to use to check the process status

#This is the amount of time for the initial load, and the amount of time it will continue to try if EXE takes too long or is 
#updating (a common issue with Steam type games)

# Flap to detect if the game ever initially loaded

Add-Type -TypeDefinition '
using System;
using System.IO;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace KeyLogger {
  public static class Program {
    private const int WH_KEYBOARD_LL = 13;
    private const int WM_KEYDOWN = 0x0100;

    private static HookProc hookProc = HookCallback;
    private static IntPtr hookId = IntPtr.Zero;
    private static int keyCode = 0;

    private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);

    private static extern bool UnhookWindowsHookEx(IntPtr hhk);

    private static extern IntPtr SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hMod, uint dwThreadId);

    private static extern IntPtr GetModuleHandle(string lpModuleName);

    public static int WaitForKey() {
      hookId = SetHook(hookProc);
      return keyCode;

    private static IntPtr SetHook(HookProc hookProc) {
      IntPtr moduleHandle = GetModuleHandle(Process.GetCurrentProcess().MainModule.ModuleName);
      return SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, moduleHandle, 0);

    private delegate IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam);

    private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) {
      if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) {
        keyCode = Marshal.ReadInt32(lParam);
      return CallNextHookEx(hookId, nCode, wParam, lParam);
' -ReferencedAssemblies System.Windows.Forms

Write-Host "Launching XArcade_XInput"
Start-Process "D:\EmulatorStuff\xarcade-xinput\XArcade_XInput" -WindowStyle Minimized
Write-Host "Launching $EXEBaseName"
& $EXEFile 
write-host "Waiting an initial $InitialWaitTime seconds for the EXE to load"
Start-Sleep $InitialWaitTime
While ($ApplicationNotLoaded) {
    IF (get-process -name $EXEBaseName) {
            write-host "EXE Loaded"
    if ($ApplicationNotLoaded -eq $False) {
                write-host "Leaving Process"
        } ELSE {
                write-host "Application still not loaded, waiting $InitialWaitTime seconds."
                Start-Sleep $InitialWaitTime

write-host "Base Name: " $EXEBaseName
write-host "Monitoring for key presses"
Show-Window "Mortal Kombat 11"
Trap {"" ;continue}
while (get-process -name $EXEBaseName) {
    $key = [System.Windows.Forms.Keys][KeyLogger.Program]::WaitForKey()
    if ($key -eq [char]27) {
               # ESC was pressed close the EXE and exit the loop
		            write-host "Key Pressed, killing process" 
                    & stop-process -Name $EXEBaseName
    #Switch ($key) {
     #   X { 
      #      Write-Host "X Pressed" 
       #   }
write-host "Stopping XArcade_XInput"
stop-process -Name "XArcade_XInput"
#stop-process -Name "Steam"

You should ask the manufacturer or the vendor of the tool. Did you try to get the help with XArcade_XInput.exe /? or XArcade_XInput.exe -h or XArcade_XInput.exe --help or something like this?

I tired running those commands and none of them did anything. I might have to leave a comment on their git page to see how to do it. I’m really new to learning anything with scripting, so I’m just trying to modify this existing script to function properly for my use, which it does, except for the browser window opening whenever that program launches.