I have a need to run some automation tasks in a web browser control but I seem to be facing a few limitations/unknowns that I\'m not 100% sure how to resolve. The applicatio
No, you cannot run the WebBrowser control in InPrivate mode; it's simply not a supported scenario.
Yes, you can run two instances of IE in InPrivate mode and isolate them from each other.
Use the command line: iexplore.exe -private -nomerge
Here's some code that will give you access to an InPrivate IE
Friend Function Open(Optional ByVal Url As String = "about:blank", Optional ByVal WindowState As ProcessWindowStyle = ProcessWindowStyle.Hidden) As WebBrowser
On Error Resume Next
Dim Start As New ProcessStartInfo
Dim Windows = New ShellWindowsClass
Dim Count = Windows.Count
Start.FileName = "iexplore.exe"
Start.Arguments = "-private -nomerge " & Url
If WindowState = ProcessWindowStyle.Hidden Then
Start.WindowStyle = ProcessWindowStyle.Minimized
Else
Start.WindowStyle = WindowState
End If
Process.Start(Start)
Wait.Reset()
Do
If Windows.Count > Count Then Exit Do
Loop While Wait.Waiting
Browser = Windows(Count)
Browser.Visible = (WindowState <> ProcessWindowStyle.Hidden)
Return Browser
End Function