-
-
Save DanielSmon/cc3fa072857f0272257a5fd451768c3a to your computer and use it in GitHub Desktop.
@ECHO OFF | |
REM Uses the file name as the profile name | |
SET MSTEAMS_PROFILE=%~n0 | |
ECHO - Using profile "%MSTEAMS_PROFILE%" | |
SET "OLD_USERPROFILE=%USERPROFILE%" | |
SET "USERPROFILE=%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%" | |
REM Ensure there is a downloads folder to avoid error described at | |
REM https://gist.github.com/DanielSmon/cc3fa072857f0272257a5fd451768c3a | |
mkdir "%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%\Downloads" | |
REM Fixes missing "Desktop" folder | |
mkdir "%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%\Desktop" | |
ECHO - Launching MS Teams with profile %MSTEAMS_PROFILE% | |
cd "%OLD_USERPROFILE%\AppData\Local\Microsoft\Teams" | |
"%OLD_USERPROFILE%\AppData\Local\Microsoft\Teams\Update.exe" --processStart "Teams.exe" |
this is awesome Thanks!!!
This cmd was working perfectly for me and my colleagues but recently we have been getting the following JavaScript error. I assume that either the OS or Teams was updated by our corporate IT.
Error: Failed to get 'downloads path
at Object.<anonymous> (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\lib\loca...:54)
at Module.compile (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\externa...:36)
at Object.Module.extensions..js (internal/modules/cjs/loader.js:986:10)
at Module.load (internal/modules/cjs/loader.js:816:32)
at Function.Module._load (electron/js2c/asar.js:748:26)
at Module.require (internal/modules/cjs/loader.js:853:19)
at require (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\externa...:28)
at Object.<anonymous> (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\lib\loca...:20)
at Module.compile (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\externa...:36)
Any ideas on a cause or fix?
Jup, this hit me too. Sadly not working anymore.
There is a workaround - create a "Downloads" folder in
%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%\
There is a workaround - create a "Downloads" folder in
%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%\
Thanks @xLAva, since this was reported I've now also started experiencing this issue. Creating the downloads folder fixed it for me too. I've now added a mkdir
command on line 12 to take care of this in the main script. Cheers!
For what it's worth, here's the same script in Powershell:
$profileName = [io.path]::GetFileNameWithoutExtension($PSCommandPath)
Write-Output "Launching $profileName Teams Profile ..."
$userProfile = $env:USERPROFILE
$appDataPath = $env:LOCALAPPDATA
$customProfile = "$appDataPath\Microsoft\Teams\CustomProfiles\$profileName"
$downloadPath = Join-Path $customProfile "Downloads"
if (!(Test-Path -PathType Container $downloadPath)) {
New-Item $downloadPath -ItemType Directory |
Select-Object -ExpandProperty FullName
}
$env:USERPROFILE = $customProfile
Start-Process `
-FilePath "$appDataPath\Microsoft\Teams\Update.exe" `
-ArgumentList '--processStart "Teams.exe"' `
-WorkingDirectory "$appDataPath\Microsoft\Teams"
thanks @DanielSmon . thanks @dfbaskin for the powershell port.
great work. really appreciate it. this solved so many of my headaches.
This worked for me today using the latest version of Teams.
Check out my profile https://github.com/TritusIX I fixed the problem with unavailable "Desktop" folder. @DanielSmon it would be great if you could add the fix into main script.
Hey @TritusIX, sorry I can't see anything on your GitHub profile? Do you have a direct link? Thanks
Hey @DanielSmon here´s the link: https://gist.github.com/TritusIX/9c02b8b7de8e68dbb30cab58f9c52cd2
You´re welcome.
Thanks @TritusIX, now added!
Can also use this - https://github.com/TonCunha/multi-microsoft-teams
After using two Team's profiles for about 6 weeks, Outlook started using the wrong Teams profile to create Teams meeting invites.
Outlook signed into [email protected]
Teams1 signed into [email protected]
Teams2 signed into [email protected]
When I create a new meeting request in Outlook and insert the Teams link, it inserts a link from [email protected] not the correct account. Any have a fix for this?
It'll use your default teams, i.e the process / instance that runs normally without using the script. You'll just have to make sure your default Teams is the one thst you want to use with Outlook.
This will create any directories that don't exist and will create a junction to existing Desktop and Downloads so you don't have to deal with multiple destinations
$profile = [io.path]::GetFileNameWithoutExtension($PSCommandPath)
$LAD = $env:LOCALAPPDATA
$teams = "$LAD\Microsoft\Teams\"
$customProfiles = "$teams\CustomProfiles"
$curProfile = "$customProfiles\$profile"
$downloads = "$curProfile\Downloads"
$desktop = "$curProfile\Desktop"
if (!(Test-Path $customProfiles)) {New-Item $customProfiles -ItemType Directory}
if (!(Test-Path $curProfile)) {New-Item $curProfile -ItemType Directory}
if (!(Test-Path $downloads)) {
$path = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders'
$target = (Get-ItemProperty "$path")."{374DE290-123F-4565-9164-39C4925E467B}"
New-Item -path "$downloads" -ItemType Junction -value "$target"
}
if (!(Test-Path $desktop)) {
$target = [Environment]::GetFolderPath("Desktop")
New-Item -path "$desktop" -ItemType Junction -value "$target"
}
$env:USERPROFILE = $curProfile
Start-Process -filepath "$teams\update.exe" -argumentlist '--processStart "Teams.exe"' `
-WorkingDirectory "$teams"
After using two Team's profiles for about 6 weeks, Outlook started using the wrong Teams profile to create Teams meeting invites.
Outlook signed into [email protected] Teams1 signed into [email protected] Teams2 signed into [email protected]
When I create a new meeting request in Outlook and insert the Teams link, it inserts a link from [email protected] not the correct account. Any have a fix for this?
facing the same issue.
Outlook signed into [email protected]
Teams1 [The normal Teams] signed into [email protected]
Teams2 [Teams launched with script] signed into [email protected]
When I create meetings, Outlook is using the [email protected] account/details to create invites.
Anyone able to solve this ?
After using two Team's profiles for about 6 weeks, Outlook started using the wrong Teams profile to create Teams meeting invites.
Outlook signed into [email protected] Teams1 signed into [email protected] Teams2 signed into [email protected]
When I create a new meeting request in Outlook and insert the Teams link, it inserts a link from [email protected] not the correct account. Any have a fix for this?facing the same issue.
Outlook signed into [email protected] Teams1 [The normal Teams] signed into [email protected] Teams2 [Teams launched with script] signed into [email protected]
When I create meetings, Outlook is using the [email protected] account/details to create invites.
Anyone able to solve this ?
Why not just switch the accounts in your Teams? At the end of the day, you have 2 different accounts running in 2 different Teams, so it doesn't matter if they're swapped, as long as Outlook works with the correct Teams account.
Pra mim parou de funcionar.
Agora ao abrir o script ele sempre abre a mesma instância do teams.
Não sei se tem ligação com mover o direório das aplicações para outro disco...
Another solution is to make two sandboxes with sanboxie, and run teams from each sandbox, it will have it's own cache,credentials and will work nicely together, to make this work, disable auto-updates and loggout of the teams application that is installed in windows .
Now when you go to each sandbox you can login with each account.
After using two Team's profiles for about 6 weeks, Outlook started using the wrong Teams profile to create Teams meeting invites.
Outlook signed into [email protected] Teams1 signed into [email protected] Teams2 signed into [email protected]
When I create a new meeting request in Outlook and insert the Teams link, it inserts a link from [email protected] not the correct account. Any have a fix for this?facing the same issue.
Outlook signed into [email protected] Teams1 [The normal Teams] signed into [email protected] Teams2 [Teams launched with script] signed into [email protected]
When I create meetings, Outlook is using the [email protected] account/details to create invites.
Anyone able to solve this ?
Here is what I have done!
- Accounts > Access work or school > disconnect all work accounts.
- Disconnect all your work accounts from MS office application as well.
- Clear the teams cache and exit both instances
- Launch teams and sign in to User 1 and select "Allow my organization to manage my device"
- Launch any office application and sign to User 1
- Run the script - Teams will probably launch with User 1, so sign out
- Login to teams using User 2 and select "No, sign in to this app only".
I have been testing this for a day now and it seems to work fine.
After using two Team's profiles for about 6 weeks, Outlook started using the wrong Teams profile to create Teams meeting invites.
Outlook signed into [email protected] Teams1 signed into [email protected] Teams2 signed into [email protected]
When I create a new meeting request in Outlook and insert the Teams link, it inserts a link from [email protected] not the correct account. Any have a fix for this?facing the same issue.
Outlook signed into [email protected] Teams1 [The normal Teams] signed into [email protected] Teams2 [Teams launched with script] signed into [email protected]
When I create meetings, Outlook is using the [email protected] account/details to create invites.
Anyone able to solve this ?Here is what I have done!
- Accounts > Access work or school > disconnect all work accounts.
- Disconnect all your work accounts from MS office application as well.
- Clear the teams cache and exit both instances
- Launch teams and sign in to User 1 and select "Allow my organization to manage my device"
- Launch any office application and sign to User 1
- Run the script - Teams will probably launch with User 1, so sign out
- Login to teams using User 2 and select "No, sign in to this app only".
I have been testing this for a day now and it seems to work fine.
Or you can do this the proper way, where you load the Teams .dll addin for the Teams profile that you want:
- Go to your Outlook addin and remove the Teams meeting addin:
-
Close Outlook completely. Terminate the .exe process.
-
Go into Teams and untick this setting. Leave it on for the Teams profile that you want to pair with Outlook. In other words, you should only have this setting enabled for just one Teams.
- Find the TeamsMeetingAddin folder under here:
%LocalAppData%\Microsoft\TeamsMeetingAddin
- Copy that folder to your Teams profile:
%LocalAppData%\Microsoft\Teams\CustomProfiles\XXXXXXXXX\AppData\Local\Microsoft\
Where XXXXXXXXX is the name of your custom profile folder.
- Go into the following path
%LocalAppData%\Microsoft\Teams\CustomProfiles\XXXXXXXXX\AppData\Local\Microsoft\TeamsMeetingAddin\1.0.22147.1\x64
Obviously, adjust the path based on your profile folder name and the version of your addin.
- Copy the path of the addin .dll file:
- Open CMD or Powershell as ADMIN and paste your path here:
regsvr32.exe /n /i:user "C:\Users\Ricky\AppData\Local\Microsoft\Teams\CustomProfiles\Teams-Crayon-Profile\AppData\Local\Microsoft\TeamsMeetingAddin\1.0.22147.1\x64\Microsoft.Teams.AddinLoader.dll"
- Go into Outlook addin and you should find your addin added. If it’s disabled, then just enable it.
Awesome! Now all your future Teams meeting created from Outlook will be able to open with the correct Teams profile!
P.S - if you run into issues where the addin doesn’t show up in Outlook, then just import the following registry key below.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\outlook\addins\TeamsAddin.FastConnect]
"Description"="Microsoft Teams Meeting Add-in for Microsoft Office"
"FriendlyName"="Microsoft Teams Meeting Add-in for Microsoft Office"
"LoadBehavior"=dword:00000003
After using two Team's profiles for about 6 weeks, Outlook started using the wrong Teams profile to create Teams meeting invites.
Outlook signed into [email protected] Teams1 signed into [email protected] Teams2 signed into [email protected]
When I create a new meeting request in Outlook and insert the Teams link, it inserts a link from [email protected] not the correct account. Any have a fix for this?facing the same issue.
Outlook signed into [email protected] Teams1 [The normal Teams] signed into [email protected] Teams2 [Teams launched with script] signed into [email protected]
When I create meetings, Outlook is using the [email protected] account/details to create invites.
Anyone able to solve this ?Here is what I have done!
- Accounts > Access work or school > disconnect all work accounts.
- Disconnect all your work accounts from MS office application as well.
- Clear the teams cache and exit both instances
- Launch teams and sign in to User 1 and select "Allow my organization to manage my device"
- Launch any office application and sign to User 1
- Run the script - Teams will probably launch with User 1, so sign out
- Login to teams using User 2 and select "No, sign in to this app only".
I have been testing this for a day now and it seems to work fine.
Or you can do this the proper way, where you load the Teams .dll addin for the Teams profile that you want:
- Go to your Outlook addin and remove the Teams meeting addin:
- Close Outlook completely. Terminate the .exe process.
- Go into Teams and untick this setting. Leave it on for the Teams profile that you want to pair with Outlook. In other words, you should only have this setting enabled for just one Teams.
- Find the TeamsMeetingAddin folder under here:
%LocalAppData%\Microsoft\TeamsMeetingAddin
- Copy that folder to your Teams profile:
%LocalAppData%\Microsoft\Teams\CustomProfiles\XXXXXXXXX\AppData\Local\Microsoft\
Where XXXXXXXXX is the name of your custom profile folder.
- Go into the following path
%LocalAppData%\Microsoft\Teams\CustomProfiles\XXXXXXXXX\AppData\Local\Microsoft\TeamsMeetingAddin\1.0.22147.1\x64
Obviously, adjust the path based on your profile folder name and the version of your addin.
- Copy the path of the addin .dll file:
- Open CMD or Powershell as ADMIN and paste your path here:
regsvr32.exe /n /i:user "C:\Users\Ricky\AppData\Local\Microsoft\Teams\CustomProfiles\Teams-Crayon-Profile\AppData\Local\Microsoft\TeamsMeetingAddin\1.0.22147.1\x64\Microsoft.Teams.AddinLoader.dll"
- Go into Outlook addin and you should find your addin added. If it’s disabled, then just enable it.
Awesome! Now all your future Teams meeting created from Outlook will be able to open with the correct Teams profile!
P.S - if you run into issues where the addin doesn’t show up in Outlook, then just import the following registry key below.
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Office\outlook\addins\TeamsAddin.FastConnect] "Description"="Microsoft Teams Meeting Add-in for Microsoft Office" "FriendlyName"="Microsoft Teams Meeting Add-in for Microsoft Office" "LoadBehavior"=dword:00000003
Thanks! Step 8 - use powershell as an admin, CMD throws an error.
Hi everyone, It seems like there has been made changes to Teams (Microsoft Teams version 24060.2623.2790.8046), and this excellent script does not work anymore:
The update.exe seems to have been removed and a new method deployed.
Any ideas how to modify to the new Teams?
Ideally there is no reason to run a second instance of Teams since the new teams allows you to connect to multiple work accounts at the same time. Moreover, outlook now allows you to choose which teams account you want to create the meeting from.
Hi everyone, It seems like there has been made changes to Teams (Microsoft Teams version 24060.2623.2790.8046), and this excellent script does not work anymore:
The update.exe seems to have been removed and a new method deployed.
Any ideas how to modify to the new Teams?Ideally there is no reason to run a second instance of Teams since the new teams allows you to connect to multiple work accounts at the same time. Moreover, outlook now allows you to choose which teams account you want to create the meeting from.
Hi @Sudipkumarc
You are right that the new version can handle several logins, as was the old version of teams. I believe that this script was created in order to have several accounts open at any given time.
As @sebastienbo states, it is not possible to look in both accounts simultaneously, and hence this annoying feature has been reintroduced by MS.
Has anyone found a method for running more than 1 instance of the teams app simultaneously?
I am having the same issue. I have recently joined a project and I was invited to several channels for the new project in another organization, I don't see anything unless I switch the organization, but then I miss the notification from my own organization.
I have been surfing the web for a solution, but nothing works. It seems that the "CustomProfiles" aren't there anylong.
I played around with this again. Script still works for Teams Classic. The "New Teams" is a UWP app and I didn't find a way to open a second window.
As an alternative you can create multiple profiles in Firefox or Chrome and open a Teams instance in each browser instance
@gidifede yes, this is what I'm doing everyday: I open my computer and start Teams as usual through the Start Menu. Then I launch my second Teams using this script, connected to my other tenant.
What's tricky is that the default Teams app will be the one launched without the script, it means that if you click on a Teams meeting link, it is the default app that will be launched. You need to keep that in mind or you'll face some surprises.