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. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
-
Microsoft : Edge is better than Chrome
by
Alex5723
5 hours, 3 minutes ago -
The EU launched DNS4EU
by
Alex5723
5 hours, 12 minutes ago -
Cell Phone vs. Traditional Touchtone Phone over POTS
by
280park
3 hours, 18 minutes ago -
Lost access to all my networked drives (shares) listed in My Computer
by
lwerman
10 hours, 39 minutes ago -
Set default size for pasted photo to word
by
Cyn
16 hours, 40 minutes ago -
Dedoimedo tries 24H2…
by
Cybertooth
4 hours, 47 minutes ago -
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
1 day, 15 hours ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
1 day, 12 hours ago -
Small desktops
by
Susan Bradley
6 hours, 19 minutes ago -
Totally disable Bitlocker
by
CWBillow
9 hours, 12 minutes ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
1 day, 13 hours ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
2 days, 19 hours ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
14 hours, 21 minutes ago -
Mystical Desktop
by
CWBillow
2 days, 22 hours ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
2 days, 4 hours ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
20 hours, 9 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
3 days, 14 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
3 days, 16 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
3 days, 15 hours ago -
What is wrong with simple approach?
by
WSSpoke36
1 day, 13 hours ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
4 days, 2 hours ago -
Location, location, location
by
Susan Bradley
2 days, 16 hours ago -
Cannot get a task to run a restore point
by
CWBillow
4 days, 3 hours ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
3 days, 18 hours ago -
June 2025 Office non-Security Updates
by
PKCano
4 days, 14 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
3 hours, 27 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
4 days, 14 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
5 days ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
4 days, 3 hours ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
5 days, 9 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.