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?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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, 6 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, 6 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
-
Who knows what?
by
Will Fastie
27 seconds ago -
My top ten underappreciated features in Office
by
Peter Deegan
1 hour, 54 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
1 hour, 2 minutes ago -
Misbehaving devices
by
Susan Bradley
2 hours, 34 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
15 hours, 40 minutes ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
11 hours, 24 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
14 hours, 14 minutes ago -
Discover the Best AI Tools for Everything
by
Alex5723
14 hours, 23 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
4 hours, 32 minutes ago -
Rufus is available from the MSFT Store
by
PL1
12 hours, 34 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
1 day, 15 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
21 hours, 50 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
18 hours, 1 minute ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
1 day, 11 hours ago -
Office gets current release
by
Susan Bradley
1 day, 13 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
3 days, 3 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
2 days, 12 hours ago -
Stop the OneDrive defaults
by
CWBillow
3 days, 4 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
3 days, 14 hours ago -
X Suspends Encrypted DMs
by
Alex5723
3 days, 16 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
3 days, 17 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
3 days, 17 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
3 days, 18 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days, 6 hours ago -
Enabling Secureboot
by
ITguy
3 days, 13 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
4 days, 2 hours ago -
No more rounded corners??
by
CWBillow
3 days, 22 hours ago -
Android 15 and IPV6
by
Win7and10
3 days, 11 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
4 days, 14 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
4 days, 17 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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.