Search code examples
windowsgoogle-chromepowershelluser-profile

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


Solution

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