MS Edge keeps adding new profiles when I launch several Edge browsers with existing profiles from command line

Zhu, Ligong 260 Reputation points
2023-09-08T11:16:46.36+00:00

Hi, I have code to launch Edge browser using existing profile (such as 'Profile 1') from command line (because we don't want their session merged). After several launches, it looks like Edge starts to create new profile on its own so the total number of profiles keeps growing. Can you confirm this?

Since a user may do this many times a day it means a lot of new profiles will be automatically created by Edge, can you confirm this? Is there any problem associated with this?

I can't find a way to reuse a profile after user closes the Edge because I can't find a way to retrieve profile name inside Edge browser using JavaScript, do you have any suggestion how to do it?

Thanks.

Microsoft Edge | Microsoft Edge development
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-09-08T12:37:50.1333333+00:00

    Hi @Zhu, Ligong,

    After several launches, it looks like Edge starts to create new profile on its own so the total number of profiles keeps growing. Can you confirm this?

    I tried to reproduce the problem you mentioned, but it failed. Something like this:

    User's image

    and command line(execute 3 times): "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --profile-directory="Profile 1".

    After I closed these edge browser instances, I checked the location files, and no change happened, no new profiles create(like profile 3, profile 4...), no multiple ones for same profile (like Profile 1(2), Profile 1(3)). So could you describe what has changed in these files since the problem occurred?

    According to your command line path, find the Edge application and check its properties. Does the target contain other command parameters?

    I can't find a way to reuse a profile after user closes the Edge because I can't find a way to retrieve profile name inside Edge browser using JavaScript, do you have any suggestion how to do it?

    You can navigate to edge://version, and check the Profile path property.

    Best regards,

    Xudong Peng


    If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.