Open a website in background Open a website in background powershell powershell

Open a website in background


Use Minimized for the win stile:

Start-Process -WindowStyle Minimized "C:\Program Files\Internet Explorer\iexplore.exe" "www.google.com" 

What is the point to open web site as background process. That is very bad architecture.


This opens a window minimized:

$browserurl = 'https://stackoverflow.com/questions/47908413/open-a-website-in-background'$p = [System.Diagnostics.Process]::new()$P.StartInfo.Arguments = [string]::Format("{0}{1}", "-nomerge ", $browserurl)$P.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Minimized$P.StartInfo.CreateNoWindow = $true$P.StartInfo.UseShellExecute = $true$P.StartInfo.FileName = "iexplore.exe"$P.Start()

I got this code from this C# post.. It has another link to working with IE's Com objects.Opening a Hidden Internet Explorer Window without it getting Focus?


Realised it via Google Chrome Portable and the following AutoIT-Script:

#include <Constants.au3>_Start_Minimized_Chrome()Func _Start_Minimized_Chrome()Local $chrome = ShellExecute("C:\chrome\GoogleChromePortable.exe", '"https://website.com"')WinWait("[CLASS:Firefox_WidgetWin_1]", "")Local $WinList = WinList()For $i = 1 To $WinList[0][0]    If $WinList[$i][0] <> "" And StringInStr($WinList[$i][0], " - Mozilla Firefox", 1) Then WinSetState($WinList[$i][1], "", @SW_HIDE)    NextEndFunc   ;==>_Start_Minimized_Chrome