I'm trying to get some fairly simple (and identical) tasks automated for multiple user profiles in one flow. However, whilst it's a simple job when I'm dealing with only one profile, I seem unable to scale it to multiples.
The pseudo code is essentially as follows:
***
For each profile, have a look in it's allocated Edge browser and...
if there's anything needing attention ("is there a defined text present on the webpage?")
Press a few buttons to basically process it
Then go to sleep, wake up a bit later and rinse and repeat forever
***
When I do it on a single profile, I load it up using "Launch new Microsoft Edge" (launch mode = launch new instance) and store the instance into the variable Edge1. I then use that variable to do (hard-coded) navigations, new tabs, button presses etc. and it all works perfectly.
I'm thinking that what I'd like to do is basically say "For the next profiles, load up new Edges into browser variables Edge2, Edge3 etc. and then perform the same actions on each, but that's only a guess on direction (which I have not yet managed to get working).
* Good News 1: I'm happy to hard code everything, if I can then just come in in the morning and run the code (I don't need the profile list to be dynamic or anything as changes are rare)
* Good News 2: If I need to do any setups before running the code in the morning, that's ok too as long as I don't actually have to rewrite the flow each day.
* Bad news: I'm new at Power Automate, so don't actually know what I'm doing 😉
* Environment: Win11 (21H2, Build 22000.369), dual monitors, fast PC, MS Edge Chrome (98.0.1109.43). Profiles are already set up on Edge and I can manually jump between them without a problem.
* Things I've tried:
- Clicking on the next profile in Edge pops up a new browser instance, which would be fine if I had a variable holding that browser instance. If I could somehow reference it as (say) "Edge2", that would make things easy.
- Setting up shortcuts for each profile will certainly bring up the Edges under different profiles, but again, without a reference variable, I can't communicate with them as browsers
- Setting up the whole thing as UI rather than Web automation. As well as being rather tedious, I found that Windows tended to change the name of the windows at each run. This actually meant that I could in fact get it all working, but had to recode the whole thing (setting up new UI elements) every day!
Any suggestions gratefully received!
JC
You get a browser instance, but you cannot use it if Edge was started with a defined profile (using msedge.exe argument --profile-directory=ProfileName) because you get an error for every action using this instance.
The same error occurs if you define a default profile for external links or entries for the automatic profile switch in the browser settings.
The only work-around I found is to set the default profile in the registry (create missing keys) before opening the browser:
Path: HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Edge
Property Name: EdgeDefaultProfileEnabled
Property Type: REG_SZ (Text)
Property Value: ProfileName (see last part of profile path in edge://version)
Use the "Run Application" action like in the post before this one, then use the "Launch New Microsoft Edge" action, but set it to "Attach to running instance" and choose the property you want to connect by, that will then produce a browser handle.
"This wont give us Browser Instance Hence unable to use Browser Automation Tools" How to fix?
Hi,
In Edge
Type edge://version into the address bar and press Enter. You should see a page of data.
One item in the list is Profile path, whose last element (after the last '\') is the 'profile directory name,' probably Profile n. Copy the name or make a note of it.
Then you can use the focus window
As you can see there is work and personal edge in the list.
Hope the content above may help you.
Best Regards
If my answer helps, then please consider Accept it as the solution to help the other members find it more quickly.
eetuRobo
18
Super User 2025 Season 1
stampcoin
6
John_Mavridis
6
Microsoft Employee