After setting Windows Terminal as the default terminal, WT cannot be called even after running .bat and .ps1 files #15713

Closed
opened 2026-01-31 04:46:25 +00:00 by claunia · 5 comments
Owner

Originally created by @DustinWin on GitHub (Oct 27, 2021).

After installing Windows Terminal v1.11.2921.0 (official version), set the default terminal to WT.
QQ截图20211027162352

But after running the .bat file and the .ps1 file, the CMD and PowerShell terminal are still invoked.

Originally created by @DustinWin on GitHub (Oct 27, 2021). After installing Windows Terminal v1.11.2921.0 (official version), set the default terminal to WT. ![QQ截图20211027162352](https://user-images.githubusercontent.com/45238096/139029429-caa23aa3-cc4f-4f41-b814-dc6afadd2c3b.png) But after running the .bat file and the .ps1 file, the CMD and PowerShell terminal are still invoked.
claunia added the Issue-FeatureResolution-DuplicateArea-DefApp labels 2026-01-31 04:46:25 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Oct 27, 2021):

  • Do you have an example bat file that repros this?
  • Does launching cmd.exe directly launch the Terminal?
  • Do you have the VC Redistributable installed?
    image
@zadjii-msft commented on GitHub (Oct 27, 2021): * Do you have an example `bat` file that repros this? * Does launching `cmd.exe` directly launch the Terminal? * Do you have the VC Redistributable installed? ![image](https://user-images.githubusercontent.com/18356694/139054972-77aaeed4-876f-4362-98e9-74631c85f144.png)
Author
Owner

@DustinWin commented on GitHub (Oct 27, 2021):

  • Do you have an example bat file that repros this?
  • Does launching cmd.exe directly launch the Terminal?
  • Do you have the VC Redistributable installed?
    image

I found the rule: when you right-click the .bat file and choose to run as administrator, the CMD terminal will pop up; if you open the .bat file directly, you will open the Windows Terminal.

@DustinWin commented on GitHub (Oct 27, 2021): > * Do you have an example `bat` file that repros this? > * Does launching `cmd.exe` directly launch the Terminal? > * Do you have the VC Redistributable installed? > ![image](https://user-images.githubusercontent.com/18356694/139054972-77aaeed4-876f-4362-98e9-74631c85f144.png) I found the rule: when you right-click the .bat file and choose to run as administrator, the CMD terminal will pop up; if you open the .bat file directly, you will open the Windows Terminal.
Author
Owner

@zadjii-msft commented on GitHub (Oct 27, 2021):

Unfortunately, this is by design right now. Due to a limitation in the app platform it is impossible for Terminal to be "discovered" as the handler when the application that needs a terminal is running elevated.

/dup #10276

@zadjii-msft commented on GitHub (Oct 27, 2021): > Unfortunately, this is by design right now. Due to a limitation in the app platform it is impossible for Terminal to be "discovered" as the handler when the application that needs a terminal is running elevated. /dup #10276
Author
Owner

@ghost commented on GitHub (Oct 27, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Oct 27, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@DustinWin commented on GitHub (Oct 27, 2021):

Unfortunately, this is by design right now. Due to a limitation in the app platform it is impossible for Terminal to be "discovered" as the handler when the application that needs a terminal is running elevated.

That's it, thanks for the reply!

@DustinWin commented on GitHub (Oct 27, 2021): > Unfortunately, this is by design right now. Due to a limitation in the app platform it is impossible for Terminal to be "discovered" as the handler when the application that needs a terminal is running elevated. That's it, thanks for the reply!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15713