I use Teams daily and although everything else I use in a day opens automatically when I click a batch file, I can’t get Teams to open this way.
All I want is to add a line to a batch file that opens teams when the batch file is run, does anyone know how to achieve this please?
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Can’t get MS-Teams to open via batch file
Home » Forums » AskWoody support » Productivity software by function » Other MS apps » Can’t get MS-Teams to open via batch file
- This topic has 27 replies, 7 voices, and was last updated 1 year, 5 months ago by
Saidul Karim.
Tags: Teams teams batch
AuthorTopicBoriscat
AskWoody LoungerApril 10, 2020 at 3:47 am #2232453Viewing 19 reply threadsAuthorReplies-
Paul T
AskWoody MVP -
anonymous
Guest
-
Boriscat
AskWoody LoungerBoriscat
AskWoody Loungeranonymous
GuestBoriscat
AskWoody LoungerApril 10, 2020 at 2:44 pm #2232947When you reboot your computer it auto logs in/opens. Does yours not do this?
I don’t want to auto login. I need about a dozen apps and files open for work, so I have all of them open from 1 batch script. Teams is the only one I can’t get to work.
I just want it to open when it is called by a batch script.
I have one that gets me half way there, but the window comes up with do you wish to allow this program to make changes to your computer, even if I turn UAC all the way off.anonymous
GuestApril 10, 2020 at 5:21 pm #2233014(2nd anonymous, reading first and comparing)
Is there already an instance of Teams running? Is it designed to not allow multiple iterations?
Anonymous above suggests the first question is likely. I ask the second, because I am not familiar with the Microsoft product.
Separately, is this a security feature rather than a design flaw?
This could be MS’s first line of defense to malicious code changing your Teams settings.
-
Boriscat
AskWoody Lounger -
anonymous
GuestApril 11, 2020 at 3:40 pm #2233315It is a Microsoft application in a Microsoft environment, so yes they have shown to be somewhat controlling in the past.
It is difficult to trouble shoot a negative. I do not have this program. Have any of these other advisors successfully launched MS Teams from the command line? What syntax was used in this successful example?
Contrasting failure with success is more informative than guessing.
(I am #post-2233014)
-
Paul T
AskWoody MVPApril 11, 2020 at 1:38 am #2233132So I need to have the string as C:\Users\Joe.Bloggs\AppData\Local\Microsoft\Teams\current\Teams.exe?
Open Explorer.
Enter %appdata% in the location bar and press Enter.You will see the path for your user and can navigate to “Local\Microsoft\Teams\current” to confirm teams.exe exists.
cheers, Paul
1 user thanked author for this post.
abbodi86
AskWoody_MVPBoriscat
AskWoody LoungerApril 11, 2020 at 1:48 pm #2233290So I need to have the string as C:\Users\Joe.Bloggs\AppData\Local\Microsoft\Teams\current\Teams.exe?
Open Explorer.
Enter %appdata% in the location bar and press Enter.You will see the path for your user and can navigate to “Local\Microsoft\Teams\current” to confirm teams.exe exists.
cheers, Paul
I do know it exists, it works fine. I just need it to work when called from a batch script
Maybe my question should be, is it possible to write a script that answers yes automatically to a windows popup window?Boriscat
AskWoody Lounger-
Paul T
AskWoody MVPApril 12, 2020 at 12:33 am #2233440%appdata% gives you the correct user profile. After that it’s easy to change directory.
is it possible to write a script that answers yes automatically to a windows popup window
AutoIt or AutoHotKey will do that for you, allowing you to wait for the window you want to send the OK to.
If you need help writing for either, ask. 🙂cheers, Paul
Boriscat
AskWoody LoungerApril 12, 2020 at 4:28 pm #2233629%appdata% gives you the correct user profile. After that it’s easy to change directory.
is it possible to write a script that answers yes automatically to a windows popup window
AutoIt or AutoHotKey will do that for you, allowing you to wait for the window you want to send the OK to.
If you need help writing for either, ask. 🙂cheers, Paul
Thanks but installing anotehr program simply to get teams to respond to a bat script seems heavy handed.
Sadly it looks like am just going to have to carry on as normal 🙁BATcher
AskWoody_MVPApril 13, 2020 at 6:12 am #2240549is it possible to write a script that answers yes automatically to a windows popup window?
Yes – if you really mean Yes or you mean Y
Try
echo y | <path to teams>\Teams.exe
I think you have already found in which folder Teams.exe is situated? Or have you?
If so, just plug it in…
BATcher
Plethora means a lot to me.Boriscat
AskWoody LoungerApril 13, 2020 at 9:38 am #2240595is it possible to write a script that answers yes automatically to a windows popup window?
Yes – if you really mean Yes or you mean Y
Try
echo y | <path to teams>\Teams.exe
I think you have already found in which folder Teams.exe is situated? Or have you?
If so, just plug it in…
Yes I know where teams.exe is.
So the script would be
@echo off
start “Teams” “C:\Users\Gary\AppData\Local\Microsoft\Teams\current\Teams.exe”echo y | C:\Users\Gary\AppData\Local\Microsoft\Teams\current\Teams.exe
Paul T
AskWoody MVPRetiredGeek
AskWoody_MVPApril 14, 2020 at 9:32 am #2240917Boriscat,
I’d recommend you setup a scheduled task to run Teams checking the “Run with Highest Privileges” box. Then in your batch file call it like this:
C:\Windows\System32\schtasks.exe /run /TN "Name of Scheduled Task Here"
Note: there is no need to actually setup a schedule as you’ll be running it “On Demand”
HTH 😎
Boriscat
AskWoody Lounger-
Paul T
AskWoody MVP
Boriscat
AskWoody LoungerApril 15, 2020 at 3:39 am #2241796This works fine
CMD /C START “” “C:\Users\{your computer name}\AppData\Local\Microsoft\Teams\current\Teams.exe”
EXIT[Moderator edit] fixed the quotes to allow copy / paste – see below
CMD /C START "" "C:\Users\{yourcomputername}\AppData\Local\Microsoft\Teams\current\Teams.exe" EXIT
1 user thanked author for this post.
-
anonymous
Guest
anonymous
GuestLeighton
Guest-
Saidul Karim
Guest
geekdom
AskWoody_MVPJune 12, 2023 at 6:01 am #2565487Try running the batch file or the CMD prompt as administrator.
On permanent hiatus {with backup and coffee}
offline▸ Win10Pro 2004.19041.572 x64 i3-3220 RAM8GB HDD Firefox83.0b3 WindowsDefender
offline▸ Acer TravelMate P215-52 RAM8GB Win11Pro 22H2.22621.1265 x64 i5-10210U SSD Firefox106.0 MicrosoftDefender
online▸ Win11Pro 22H2.22621.1992 x64 i5-9400 RAM16GB HDD Firefox116.0b3 MicrosoftDefenderViewing 19 reply threads - This topic has 27 replies, 7 voices, and was last updated 1 year, 5 months ago by
-

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Patch My PC updates (free)
by
Alex5723
1 hour, 8 minutes ago -
Windows 11 Insider Preview build 26200.5570 released to DEV
by
joep517
2 hours, 51 minutes ago -
Windows 11 Insider Preview build 26120.3941 (24H2) released to BETA
by
joep517
4 hours, 39 minutes ago -
Windows 11 Insider Preview Build 22635.5305 (23H2) released to BETA
by
joep517
4 hours, 41 minutes ago -
No April cumulative update for Win 11 23H2?
by
Peobody
6 hours, 59 minutes ago -
AugLoop.All (TEST Augmentation Loop MSIT)
by
LarryK
5 hours, 12 minutes ago -
Boot Sequence for Dell Optiplex 7070 Tower
by
Serge Carniol
20 hours, 15 minutes ago -
OTT Upgrade Windows 11 to 24H2 on Unsupported Hardware
by
bbearren
23 hours, 48 minutes ago -
Inetpub can be tricked
by
Susan Bradley
1 day, 1 hour ago -
How merge Outlook 2016 .pst file w/into newly created Outlook 2024 install .pst?
by
Tex265
4 hours, 32 minutes ago -
FBI 2024 Internet Crime Report
by
Alex5723
1 day, 3 hours ago -
Perplexity CEO says its browser will track everything users do online
by
Alex5723
15 hours, 24 minutes ago -
Login issues with Windows Hello
by
CWBillow
1 day, 14 hours ago -
How to get into a manual setup screen in 2024 Outlook classic?
by
Tex265
1 day, 2 hours ago -
Linux : ARMO rootkit “Curing”
by
Alex5723
2 days, 2 hours ago -
Employee monitoring app leaks 21 million screenshots in real time
by
Alex5723
2 days, 2 hours ago -
Google AI is now hallucinating idioms
by
Alex5723
2 days, 2 hours ago -
april update
by
69800
7 hours, 12 minutes ago -
Windows 11 Insider Preview build 27842 released to Canary
by
joep517
2 days, 3 hours ago -
Quick Fix for Slowing File Explorer
by
Drcard:))
2 days, 4 hours ago -
WuMgr not loading?
by
LHiggins
23 hours, 45 minutes ago -
Word crashes when accessing Help
by
CWBillow
1 day, 8 hours ago -
New Microsoft Nag — Danger! Danger! sign-in to your Microsoft Account
by
EricB
2 days, 3 hours ago -
Blank Inetpub folder
by
Susan Bradley
2 days, 1 hour ago -
Google : Extended Repair Program for Pixel 7a
by
Alex5723
2 days, 14 hours ago -
Updates seem to have broken Microsoft Edge
by
rebop2020
2 days ago -
Wait command?
by
CWBillow
2 days, 7 hours ago -
Malwarebytes 5 Free version manual platform updates
by
Bob99
2 days, 20 hours ago -
inetpub : Microsoft’s patch for CVE-2025–21204 introduces vulnerability
by
Alex5723
3 days, 3 hours ago -
Windows 10 finally gets fix
by
Susan Bradley
3 days, 12 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.