SturmUndDrang
SturmUndDrang

Reputation: 1956

Launch Chrome with specific profile in PowerShell

I'm trying to launch Chrome in PowerShell with a specific user profile (--profile-directory parameter), but it creates a new profile instead.

I've tried:

& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory=Foobar

& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --profile-directory=Foobar"

& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --profile-directory='Foobar'"

Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory=Foobar

Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --profile-directory=Foobar"

etc....

Upvotes: 4

Views: 10342

Answers (4)

SuperMar1o
SuperMar1o

Reputation: 680

This works for a new profile from powershell

start-process Chrome "http://localhost:9876/debug.html",'--profile-directory="Profile 4"'

Upvotes: 1

Rakesh Shinde
Rakesh Shinde

Reputation: 58

Try running below commnad. This will help you to launch the chrome as different user from commandline without going through a GUI prompt. It is good by creating a .bat file and saving your credentials.

runas /user:John C:\Program Files (x86)\Google\Chrome\Application\Chrome.exe"

Upvotes: 0

Chris Wood
Chris Wood

Reputation: 53

I was still having issues with getting the powershell Start-Process command to launch chrome with multiple flags, probably because the browser versions are different 2+ years later. For me, with Windows 10 Version 1902, Chrome Version 76.0.3809.132 (Official Build) (64-bit)

Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -disable-web-security, --disable-gpu, --user-data-dir=~/chromeTemp

Adding the commas and using "chromeTemp" rather than "/path/to/User Data" was the change that worked for me.

Upvotes: 0

kriegaex
kriegaex

Reputation: 67297

Maybe you have spaces in your path name. Try this:

Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" '--profile-directory="Foo Bar"'

Or this:

& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" '--profile-directory="Foo Bar"'

Update: Please note that you cannot just use any path, but simple names like "Foo" or "Foo Bar", denoting subdirectories of c:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data, e.g. c:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Foo Bar. The directory names can be slightly different depending on your OS and OS version. If they are the same on Win7 and Win10, I have no idea. My current machine is a Win10 PC.

Upvotes: 5

Related Questions