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, 7 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 Lounger -
Boriscat
AskWoody Lounger -
anonymous
Guest -
Boriscat
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_MVP -
Boriscat
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 MVP -
RetiredGeek
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
Guest -
Leighton
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 MicrosoftDefender
Viewing 19 reply threads - This topic has 27 replies, 7 voices, and was last updated 1 year, 7 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
-
Plugged in 24-7
by
CWBillow
11 minutes ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
3 hours, 35 minutes ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
44 minutes ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
1 day, 18 hours ago -
Are Macs immune?
by
Susan Bradley
14 hours, 26 minutes ago -
HP Envy and the Function keys
by
CWBillow
1 day, 2 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
2 days, 5 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
2 days, 6 hours ago -
Unable to update to version 22h2
by
04om
20 hours, 49 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
2 days, 13 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
2 days, 13 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
1 day, 23 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
3 days, 2 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
2 days, 15 hours ago -
Is your battery draining?
by
Susan Bradley
1 hour, 18 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
3 hours, 46 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
3 days, 6 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
16 hours, 41 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
2 days, 14 hours ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
2 days, 7 hours ago -
National scam day
by
Susan Bradley
1 day, 13 hours ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
2 days, 10 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
4 days, 7 hours ago -
Tools to support internet discussions
by
Kathy Stevens
2 days, 20 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
3 days, 22 hours ago -
AI is good sometimes
by
Susan Bradley
4 days, 14 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
4 days, 4 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
5 days, 15 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
5 days, 13 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
5 days, 17 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.