Launching Brave using VBScript


I am trying to implement a VBScript (on Windows 10) that will launch two separate instances of the Brave browser, each in its own window and given its own URL. Every method I try gives me only one window but with two tabs. The URLs are assigned correctly, they’re just not in separate windows as I want.

I’m using:

Set ws = WScript.CreateObject(“WScript.Shell”)
ws.Run “”“C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\Brave.exe”" {some URL}"
ws.Run “”“C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\Brave.exe”" {some other URL}"
Set ws = Nothing

and I’ve also tried:

Set ws = WScript.CreateObject(“WScript.Shell”)
ws.Run “”“C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\Brave.exe”" {some URL}"
Set ws = Nothing
Set ws = WScript.CreateObject(“WScript.Shell”)
ws.Run “”“C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\Brave.exe”" {some other URL}"
Set ws = Nothing

Both give the same results. Can anyone help? Thanks.

Brave Version( check About Brave):
Brave is up to date

Version 1.42.95 Chromium: 104.0.5112.81 (Official Build) (32-bit)

Tried %userprofile%\AppData\Local\BraveSoftware\Brave-Browser\Application\brave.exe ?

I don’t have the parameters for passing a url, https://peter.sh/experiments/chromium-command-line-switches/ may also help

Thanks so much. I found a “–new-window” command parameter which works (but only after a small pause, “WScript.Sleep 1000”, between URLs.

I also tried your %userprofile% suggestion but I couldn’t find the right combination of single and/or double quotes to make it work. I didn’t try too long before searching for the command line though.

Thanks again.

@asol311,

If you’re talking about the path I believe it’s double quotes around the path only. But I could be wrong, I haven’t messed w/VB in years :slight_smile:

I would take VB out of the equation entirely, just for troubleshooting purposes

If you try to launch via CLI (cmd.exe), see if you can accomplish it first. Looks like you found it above with the --new-window flag :slight_smile:

To resolve environment variables in VB script (like %userprofile%), a little more code is needed. Something like this:

Set oShell = WScript.CreateObject("WScript.Shell")
userProfilePath = oShell.ExpandEnvironmentStrings( "%userprofile%" )
fullPath = userProfilePath & "\AppData\Local\BraveSoftware\Brave-Browser\Application\brave.exe"
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.