Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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....

like image 889
SturmUndDrang Avatar asked Oct 23 '25 14:10

SturmUndDrang


2 Answers

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.

like image 178
kriegaex Avatar answered Oct 26 '25 06:10

kriegaex


This works for a new profile from powershell

start-process Chrome "http://localhost:9876/debug.html",'--profile-directory="Profile 4"'
like image 32
SuperMar1o Avatar answered Oct 26 '25 06:10

SuperMar1o



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!