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:
Meghana-MSFT
Microsoft
Sep 23, 2021Could you please provide us with the commands that you are using and repro steps? So that it would be helpful for us to repro the issue.
- ericw190Sep 28, 2021Copper Contributor
Meghana-MSFTI'm sorry I get the strong feeling that my post was not read 😐 ok... commands
main issue: Command Line args to goto channels directly?
The main "command" I'm using is Teams.exe the executable to run the Teams application on Windows.
So from another application I want to be able to run the Teams.exe with a command line switch to open a certain channel directly WITHOUT going over the browser.
Another "command" I'm using is the :link:Get link to channel option from a channel I want to link to.
Now just like one can do Teams.exe sip:username@company.com to chat directly with a given user
I'd like to be able to do something like Teams.exe channel:https://teams.microsoft.com/l/channel/19%3acb55... to open up Teams with the desired channel.
Of course this does not work. What "works" is opening the channel link with a browser. But ONLY if the user already enabled all the required checks to make the Browser entitled to do so. And then one still has a Browser open and a website which does not close on its own.
So I'm asking for a command line argument to make that happen!
OK. How can I search on my own: DuckDuckGo? Google? Bing? .. There seems to be nothing of value 😕 sadly. Also the internal Help does not yield anything.
And finally like with any apps that do thing over the command line one can try "help" switches like: /? -help -h --help -? ... however nothing seems to work. All just open up the Teams app.
And whenever you do that ... also without ANY arguments the app will also print this DeprecationWarning to the console. Repro:
- Press Win key
- type cmd
- Press Enter key
- type or copy/paste
cd %LOCALAPPDATA%\Microsoft\Teams\current - type Teams.exe
- Press Enter key
Result:
- Teams app opens up
- message in the cmd window:
(node:9612) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
My version is 1.4.0.22976 at least that's the version detail on the executable.