Skip to content

Instantly share code, notes, and snippets.

@shoover
Created June 20, 2013 20:12
Show Gist options
  • Save shoover/5826184 to your computer and use it in GitHub Desktop.
Save shoover/5826184 to your computer and use it in GitHub Desktop.
Load a URL in Chrome as a new tab in a specific user profile's window
' Load a URL in Chrome as a new tab in a specific user profile's window.
' usage: chromes PROFILE [URL]
' PROFILE can be a keyword to be translated in the lookup below.
Set oShell = CreateObject ("Wscript.Shell")
Dim profile, url, cmd, args
profile = WScript.Arguments(0)
Select Case LCase(profile)
Case "personal" profile = "Default"
Case "work" profile = "Profile 2"
End Select
If WScript.Arguments.Count > 1 Then
url = WScript.Arguments(1)
Else
url = "www.google.com"
End If
cmd = "%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe"
args = " --profile-directory=""" & profile & """ " & url
oShell.Run cmd & args , 0, true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment