Forum Discussion
ericw190
Sep 21, 2021Copper Contributor
Command Line args to goto channels directly?
Hello! So in our custom tools we try to give quick access to the responsible people. Its already possible to chat with co-workers in Teams with a click. In the background: getting the executable from...
- Sep 28, 2021
Alright I got it! the command line switch to do this is msteams:
I just took such a channel link, quit Teams from the sys tray, The browser opens it with the command I'm looking for and then it will still be on the command line args of the running Teams.exe! 🤘
What I noticed is that the link is UBER long! In my case 345 characters.
The app actually complains about a LOT of stuff in there:
'tenantId' is not recognized as an internal or external command, operable program or batch file. 'deeplinkId' is not recognized as an internal or external command, operable program or batch file. 'launchAgent' is not recognized as an internal or external command, operable program or batch file. The system cannot find the file specified. 'directDl' is not recognized as an internal or external command, operable program or batch file. 'msLaunch' is not recognized as an internal or external command, operable program or batch file. 'enableMobilePage' is not recognized as an internal or external command, operable program or batch file. 'fqdn' is not recognized as an internal or external command, operable program or batch file.
So these can ALL be stripped off the link already and even groupId and type aren't needed!
One can even shorten off the name up to the slash like:
msteams:/l/channel/19:vv8s7adsd9sdf7vs9fvd9f7v9d7s@thread.tacv2/
and that's all you need: convert %3a to : and %40 to @ , cut off after tacv2/ voilà!
If you'd like to store different channels: just take the ID between : and @ and use a template like
msteams:/l/channel/19:{channel_id}@thread.tacv2/
🙇:female_sign:
ericw190
Sep 28, 2021Copper Contributor
Alright I got it! the command line switch to do this is msteams:
I just took such a channel link, quit Teams from the sys tray, The browser opens it with the command I'm looking for and then it will still be on the command line args of the running Teams.exe! 🤘
What I noticed is that the link is UBER long! In my case 345 characters.
The app actually complains about a LOT of stuff in there:
'tenantId' is not recognized as an internal or external command,
operable program or batch file.
'deeplinkId' is not recognized as an internal or external command,
operable program or batch file.
'launchAgent' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the file specified.
'directDl' is not recognized as an internal or external command,
operable program or batch file.
'msLaunch' is not recognized as an internal or external command,
operable program or batch file.
'enableMobilePage' is not recognized as an internal or external command,
operable program or batch file.
'fqdn' is not recognized as an internal or external command,
operable program or batch file.
So these can ALL be stripped off the link already and even groupId and type aren't needed!
One can even shorten off the name up to the slash like:
msteams:/l/channel/19:vv8s7adsd9sdf7vs9fvd9f7v9d7s@thread.tacv2/
and that's all you need: convert %3a to : and %40 to @ , cut off after tacv2/ voilà!
If you'd like to store different channels: just take the ID between : and @ and use a template like
msteams:/l/channel/19:{channel_id}@thread.tacv2/
🙇:female_sign:
ericw190
Sep 28, 2021Copper Contributor
Another one. If you want to point to a message via command line and have it nicely highlighted this works very similarly:
msteams:l/message/19:{channel_id}@thread.tacv2/{message_id}?
So you can get rid of https://teams.microsoft.com/ in the front and all after ? in the end.
Turns out the ? at the end is important! Just like the / at the end of the channel template.
- erik-on-windowsOct 21, 2021Copper Contributor
ericw190 how do you retrieve the channel_id?
- ericw190Oct 25, 2021Copper Contributor
OK. Step by step:
- Click the "..." on any channel.
- Hit Get link to channel
- From this huuge link take the part after "channel/19%3a" and before "%40thread.tacv2" ..
- or like described above^ convert %-notation first (%3a to : and %40 to @) and take the part after : and before @
- for example:
- that's what I called channel_id.