1

I'm trying to configure a profile in Windows Terminal that opens a new Windows Terminal window.

When I try to start C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_0.4.2382.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe there is an access denied error.

This is because the Windows Terminal is a Windows-Store-App (aka. Modern Windows App, aka. Mono App).

How can I start the WindowsTerminal.exe from the command line?

eddex
  • 1,622
  • 1
  • 15
  • 37

3 Answers3

5

The Windows Terminal can be launched simply by "wt.exe".

The proof

alt3r3d
  • 158
  • 1
  • 5
  • Nice, thanks! I marked this as the accepted answer since it provides the information that I was looking for. It can be combined with my answer below to add the correct icon. – eddex Sep 23 '19 at 19:21
2

1. Open Windows-Store-Apps from the command line

I found this answer on how to open Windows-Store-Apps: https://stackoverflow.com/a/39490206/10069673

Example: explorer.exe shell:AppsFolder\Microsoft.WindowsAlarms_8wekyb3d8bbwe!App

2. Find the name of the app

  • start WindowsTerminal
  • open the TaskManager (ctrl+shift+esc)
  • expand Windows Terminal (Preview)
  • right click on OpenConsole.exe and select "Open file location"

File location:

C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_0.4.2382.0_x64__8wekyb3d8bbwe

Final command (remove version number in directory name):

explorer.exe shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App

3. Configure Windows Terminal profile

This is how I configured my profile.

  • commandline is set to the command from step 2.
  • icon is set to the Windows Terminal logo from the app's directory
  • name is self explanatory

We don't need to configure any other properties since this profile just starts a new instance of Windows Terminal with a new tab of the default profile.

{
    "commandline": "explorer.exe shell:AppsFolder\\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App",
    "icon": "ms-appx:///Images/LockScreenLogo.scale-100.png",
    "name": "Terminal"
},

4. Final result Open Windows Terminal from Windows Terminal

eddex
  • 1,622
  • 1
  • 15
  • 37
0

The simple way in 2020

Approach 1:

  • Press WIN key + R

  • Type wt -d D:\SomeDirectory and this will open up the default shell present in the settings.json with that directory

Approach 2:

  • Go to the desired folder using the File Explorer.
  • In the address bar of the desired folder type wt -d .

https://github.com/microsoft/terminal/issues/620#issuecomment-642267289

Nisharg Shah
  • 16,638
  • 10
  • 62
  • 73