The new 'Run as Administrator' feature returns a 'cannot find WindowsTerminal.exe' error #16637

Open
opened 2026-01-31 05:18:05 +00:00 by claunia · 30 comments
Owner

Originally created by @sober-repay on GitHub (Feb 4, 2022).

Windows Terminal version

1.13.10336.0

Windows build number

10.0.19044.1466

Other Software

No response

Steps to reproduce

Holding down Ctrl when clicking the + button to open a new window as admin opens the UAC prompt for elevation but after entering credentials, it returns an error saying WindowsTerminal.exe cannot be found.

Expected Behavior

No response

Actual Behavior

Windows cannot find 'C;\Program Files\WindowsApps\Microsoft.Windows.TerminalPreview_1.13.10336...\WindowsTerminal.exe'. Make sure you typed the name correctly, and then try again.

Originally created by @sober-repay on GitHub (Feb 4, 2022). ### Windows Terminal version 1.13.10336.0 ### Windows build number 10.0.19044.1466 ### Other Software _No response_ ### Steps to reproduce Holding down Ctrl when clicking the + button to open a new window as admin opens the UAC prompt for elevation but after entering credentials, it returns an error saying WindowsTerminal.exe cannot be found. ### Expected Behavior _No response_ ### Actual Behavior Windows cannot find 'C;\Program Files\WindowsApps\Microsoft.Windows.TerminalPreview_1.13.10336...\WindowsTerminal.exe'. Make sure you typed the name correctly, and then try again.
claunia added the Issue-BugNeeds-Tag-FixProduct-TerminalPriority-1 labels 2026-01-31 05:18:05 +00:00
Author
Owner

@aermak commented on GitHub (Feb 7, 2022):

This most wanted mythic unicorn feature is still elusive

image

@aermak commented on GitHub (Feb 7, 2022): This most wanted mythic unicorn feature is still elusive ![image](https://user-images.githubusercontent.com/13432874/152756378-c487391f-68e7-469c-88de-feb8e7ba6bd8.png)
Author
Owner

@4r7w0rk commented on GitHub (Feb 7, 2022):

Same issue here.
Windows Terminal Preview
Version: 1.13.10336.0
Running on Windows 10 21H2 build 19044

@4r7w0rk commented on GitHub (Feb 7, 2022): Same issue here. Windows Terminal Preview Version: 1.13.10336.0 Running on Windows 10 21H2 build 19044
Author
Owner

@bazzer007 commented on GitHub (Feb 11, 2022):

I logged in as my admin user and installed Terminal Preview from the Store. That solved the issue for me.

@bazzer007 commented on GitHub (Feb 11, 2022): I logged in as my admin user and installed Terminal Preview from the Store. That solved the issue for me.
Author
Owner

@bthompson260 commented on GitHub (Feb 11, 2022):

I logged in as my admin user and installed Terminal Preview from the Store. That solved the issue for me.

I did something similar to solve the issue, logged in as admin user but just ran Terminal Preview and elevated a profile. Switched back to non admin user and was able to elevate a profile.

Edit: That only works after logging into the admin user and running it once. After a reboot, it continues to give the error until logging in with admin account and running it, then switching back to non-admin. I do not have it installed from the Microsoft store but installed using the msix file.

@bthompson260 commented on GitHub (Feb 11, 2022): > I logged in as my admin user and installed Terminal Preview from the Store. That solved the issue for me. I did something similar to solve the issue, logged in as admin user but just ran Terminal Preview and elevated a profile. Switched back to non admin user and was able to elevate a profile. Edit: That only works after logging into the admin user and running it once. After a reboot, it continues to give the error until logging in with admin account and running it, then switching back to non-admin. I do not have it installed from the Microsoft store but installed using the msix file.
Author
Owner

@sober-repay commented on GitHub (Feb 11, 2022):

Logging in as the admin user and installing it from the Store isn't a viable solution as then every time the app is updated, you'd have to go and log in and update the app.

@sober-repay commented on GitHub (Feb 11, 2022): Logging in as the admin user and installing it from the Store isn't a viable solution as then every time the app is updated, you'd have to go and log in and update the app.
Author
Owner

@bazzer007 commented on GitHub (Feb 12, 2022):

Logging in as the admin user and installing it from the Store isn't a viable solution as then every time the app is updated, you'd have to go and log in and update the app.

Is this true? I don't have enough experience with Store apps to know for sure, but they both run from the same directory in WindowsApps. I thought maybe "installing" it really just "enabled" it for the admin user since it's already installed but maybe it does maintain separate versioning on a per-user basis.

If that's the case, then you're right, it's not a proper solution but at least a workaround in the meantime?

Edit: Just updated my Skype app from the Store with my non-admin user and can confirm that it appears to have updated for all users on my machine. Hopefully the same would apply for future Terminal updates.

@bazzer007 commented on GitHub (Feb 12, 2022): > Logging in as the admin user and installing it from the Store isn't a viable solution as then every time the app is updated, you'd have to go and log in and update the app. Is this true? I don't have enough experience with Store apps to know for sure, but they both run from the same directory in WindowsApps. I thought maybe "installing" it really just "enabled" it for the admin user since it's already installed but maybe it does maintain separate versioning on a per-user basis. If that's the case, then you're right, it's not a proper solution but at least a workaround in the meantime? Edit: Just updated my Skype app from the Store with my non-admin user and can confirm that it appears to have updated for all users on my machine. Hopefully the same would apply for future Terminal updates.
Author
Owner

@ChristianGfK commented on GitHub (May 23, 2022):

I'm facing a similar issue: the regular Microsoft Store is not available on our work machines. I seem to be unable to install Terminal in a way so that it will also be available to my admin account, which I only use via "run as admin" and entering credentials at the UAC prompt. Logging into admin accounts interactively is frowned upon. ☹️

@ChristianGfK commented on GitHub (May 23, 2022): I'm facing a similar issue: the regular Microsoft Store is not available on our work machines. I seem to be unable to install Terminal in a way so that it will also be available to my admin account, which I only use via "run as admin" and entering credentials at the UAC prompt. Logging into admin accounts interactively is frowned upon. ☹️
Author
Owner

@stephannn commented on GitHub (Jun 15, 2022):

Hi,
we use ConfigMgr to deploy Applications and have linked the MSFB with ConfigMgr. So I installed it via ConfigMgr, which basically just triggers Store App, there is no offline package stored, and I could also do the run as admin command. However, when I received an update through the Store App I received the above mentioned error. So I uninstalled and reinstalled it again through SCCM and now it is back working. It is even the updated version... very wired

@stephannn commented on GitHub (Jun 15, 2022): Hi, we use ConfigMgr to deploy Applications and have linked the MSFB with ConfigMgr. So I installed it via ConfigMgr, which basically just triggers Store App, there is no offline package stored, and I could also do the run as admin command. However, when I received an update through the Store App I received the above mentioned error. So I uninstalled and reinstalled it again through SCCM and now it is back working. It is even the updated version... very wired
Author
Owner

@zadjii-msft commented on GitHub (Jun 15, 2022):

Oh that's a good idea! For folks that are hitting this, how did you install the Terminal? Maybe this is an issue with how scoop/choco/winget/etc installs the Terminal?

@zadjii-msft commented on GitHub (Jun 15, 2022): Oh that's a good idea! For folks that are hitting this, how did you install the Terminal? Maybe this is an issue with how `scoop`/`choco`/`winget`/etc installs the Terminal?
Author
Owner

@ChristianGfK commented on GitHub (Jun 15, 2022):

I grabbed the msixbundle file for https://apps.microsoft.com/store/detail/windows-terminal-preview/9N8G5RFZ9XK3?hl=en-us&gl=US directly from the servers (using https://store.rg-adguard.net/) and installed it.

@ChristianGfK commented on GitHub (Jun 15, 2022): I grabbed the msixbundle file for https://apps.microsoft.com/store/detail/windows-terminal-preview/9N8G5RFZ9XK3?hl=en-us&gl=US directly from the servers (using https://store.rg-adguard.net/) and installed it.
Author
Owner

@stephannn commented on GitHub (Jun 17, 2022):

Hi,

unfortunately I cannot really see how is the app going to be installed through ConfigMgr

<![LOG[+++ Starting Install enforcement for App DT "WindowsStoreBSPDeeplinkDT_Windows Terminal - Windows app package (in the Windows Store)" ApplicationDeliveryType - ScopeId_1DBF7D30-A95F-45D9-9B8D-F59DDDC39387/DeploymentType_64c2eb8c-e84d-4521-8e34-12e2a5ef53b6, Revision - 1, ContentPath - , Execution Context - User]LOG]!><time="06:54:24.231-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="appprovider.cpp:2094">
<![LOG[    The content path is not specified for DeploymentType ScopeId_1DBF7D30-A95F-45D9-9B8D-F59DDDC39387/DeploymentType_64c2eb8c-e84d-4521-8e34-12e2a5ef53b6.  Content is assumed to be locally available.]LOG]!><time="06:54:24.231-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="appprovider.cpp:2115">
<![LOG[Polling for installation status of Microsoft.WindowsTerminal_8wekyb3d8bbwe for up to 5 minutes.]LOG]!><time="06:54:27.656-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:139">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:27.673-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:28.690-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:29.720-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:30.747-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:31.777-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:32.807-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:33.833-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:34.864-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:35.900-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:36.931-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:37.953-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 45]LOG]!><time="06:54:38.973-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 90]LOG]!><time="06:54:40.007-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 90]LOG]!><time="06:54:41.033-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[Installation state = 1, progress state = 90]LOG]!><time="06:54:42.052-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170">
<![LOG[App Microsoft.WindowsTerminal_8wekyb3d8bbwe is installed successfully.]LOG]!><time="06:54:43.072-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="WmiBridgeCommon.cpp:156">
<![LOG[+++ Enforce completed for ScopeId_1DBF7D30-A95F-45D9-9B8D-F59DDDC39387/DeploymentType_64c2eb8c-e84d-4521-8e34-12e2a5ef53b6, 1 using Package: Microsoft.WindowsTerminal____8wekyb3d8bbwe. Returning: 0]LOG]!><time="06:54:43.072-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="appxhandler.cpp:635">
<![LOG[+++ AppX Install Info added. [AppDT Id: ScopeId_1DBF7D30-A95F-45D9-9B8D-F59DDDC39387/DeploymentType_64c2eb8c-e84d-4521-8e34-12e2a5ef53b6]]LOG]!><time="06:54:43.077-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="appxhandler.cpp:353">

The App in ConfigMgr just looks like that:
image

ms-windows-store:PDP?PFN=Microsoft.WindowsTerminal_8wekyb3d8bbwe

@stephannn commented on GitHub (Jun 17, 2022): Hi, unfortunately I cannot really see how is the app going to be installed through ConfigMgr ``` <![LOG[+++ Starting Install enforcement for App DT "WindowsStoreBSPDeeplinkDT_Windows Terminal - Windows app package (in the Windows Store)" ApplicationDeliveryType - ScopeId_1DBF7D30-A95F-45D9-9B8D-F59DDDC39387/DeploymentType_64c2eb8c-e84d-4521-8e34-12e2a5ef53b6, Revision - 1, ContentPath - , Execution Context - User]LOG]!><time="06:54:24.231-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="appprovider.cpp:2094"> <![LOG[ The content path is not specified for DeploymentType ScopeId_1DBF7D30-A95F-45D9-9B8D-F59DDDC39387/DeploymentType_64c2eb8c-e84d-4521-8e34-12e2a5ef53b6. Content is assumed to be locally available.]LOG]!><time="06:54:24.231-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="appprovider.cpp:2115"> <![LOG[Polling for installation status of Microsoft.WindowsTerminal_8wekyb3d8bbwe for up to 5 minutes.]LOG]!><time="06:54:27.656-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:139"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:27.673-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:28.690-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:29.720-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:30.747-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:31.777-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:32.807-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:33.833-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:34.864-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:35.900-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:36.931-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 0]LOG]!><time="06:54:37.953-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 45]LOG]!><time="06:54:38.973-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 90]LOG]!><time="06:54:40.007-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 90]LOG]!><time="06:54:41.033-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[Installation state = 1, progress state = 90]LOG]!><time="06:54:42.052-120" date="06-15-2022" component="AppEnforce" context="" type="0" thread="33372" file="WmiBridgeCommon.cpp:170"> <![LOG[App Microsoft.WindowsTerminal_8wekyb3d8bbwe is installed successfully.]LOG]!><time="06:54:43.072-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="WmiBridgeCommon.cpp:156"> <![LOG[+++ Enforce completed for ScopeId_1DBF7D30-A95F-45D9-9B8D-F59DDDC39387/DeploymentType_64c2eb8c-e84d-4521-8e34-12e2a5ef53b6, 1 using Package: Microsoft.WindowsTerminal____8wekyb3d8bbwe. Returning: 0]LOG]!><time="06:54:43.072-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="appxhandler.cpp:635"> <![LOG[+++ AppX Install Info added. [AppDT Id: ScopeId_1DBF7D30-A95F-45D9-9B8D-F59DDDC39387/DeploymentType_64c2eb8c-e84d-4521-8e34-12e2a5ef53b6]]LOG]!><time="06:54:43.077-120" date="06-15-2022" component="AppEnforce" context="" type="1" thread="33372" file="appxhandler.cpp:353"> ``` The App in ConfigMgr just looks like that: ![image](https://user-images.githubusercontent.com/38951729/174232192-08babd68-88a6-4fc9-bdc3-63f19e3e3e97.png) ms-windows-store:PDP?PFN=Microsoft.WindowsTerminal_8wekyb3d8bbwe
Author
Owner

@ChaseKnowlden commented on GitHub (Jun 18, 2022):

Not an issue for me. Works fine.

@ChaseKnowlden commented on GitHub (Jun 18, 2022): Not an issue for me. Works fine.
Author
Owner

@djohnst10 commented on GitHub (Jul 5, 2022):

I'm having similar problems as many here are having but I wanted to add more details of my specific situation in case this helps.

To me, the problem seems to happen because I am logged into a Windows 10 machine as a non-admin user that can't be elevated to have administrator rights.

I'm on a remote Windows 10 machine in a domain accessed through Remote Desktop (the modern Remote Desktop app) and a VPN. I normally log into this machine as a normal user that can't be elevated to have administrator permissions. In general for any program I want to run as an administrator when logged in as the non-admin user I get a UAC prompt where I have to enter the credentials of another user that does have administrator rights. This admin account (not called admin) was created specifically for me to use (similar admin accounts have been created for other users).

Initially I installed Windows Terminal from the Windows Store under the non-admin user. Discovering that I had to change the Windows PowerShell execution policy to RemoteSigned in order to use posh-git I tried to open an admin Terminal instance in order to run Set-ExecutionPolicy. This is something that works fine on my local machine because the same user I use remotely is a local administrator on my local machine.

With no Windows Terminal instance already running, you can try to run Windows Terminal as an Administrator by right-clicking the Windows Terminal icon in the taskbar, right-clicking on 'Terminal' and selecting 'Run as administrator'. You can also right click the Terminal icon in the Start menu or 'Terminal' in the program list, select 'More' and then select 'Run as administrator'.

A Windows 10 UAC dialog with the title "Do you want to allow this app to make changes to your device?" appears where I must enter a user name and password. After clicking the 'Yes' button, the UAC prompt goes away then reappears again exactly the same. If I enter the same admin credentials again and click the 'Yes' button the UAC dialog goes away and I see the following dialog:

image

The above dialog says "Windows cannot find 'C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.13.11431.0_x64__...\WindowsTerminal.exe'. Make sure you typed the name correctly, and then try again."

If a non-admin instance of Windows Terminal is already running, if you use any of the above methods of selecting 'Run as administrator' the UAC prompt will appear then go away once the 'Yes' button in clicked but nothing else happens after that.

If you use the Ctrl+click action on the 'Open new tab' control (the plus or + control) you see the UAC dialog once and then the same dialog.

The UAC dialog lists the program as "Unknown program" with a path of "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.13.11431.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe". This does seem to be the path the Windows Terminal runs from in non-administrator mode.

If you install Windows Terminal from the Windows Store and run it under the admin user profile everything works smoothly and you only every have to click the 'Yes' button in the UAC prompt to launch an admin Windows Terminal window.

Installing Windows Terminal in the admin user profile does nothing to change the inability to launch Windows Terminal as the admin user from the non-admin user profile.

@djohnst10 commented on GitHub (Jul 5, 2022): I'm having similar problems as many here are having but I wanted to add more details of my specific situation in case this helps. To me, the problem seems to happen because I am logged into a Windows 10 machine as a non-admin user that can't be elevated to have administrator rights. I'm on a remote Windows 10 machine in a domain accessed through Remote Desktop (the modern Remote Desktop app) and a VPN. I normally log into this machine as a normal user that can't be elevated to have administrator permissions. In general for any program I want to run as an administrator when logged in as the non-admin user I get a UAC prompt where I have to enter the credentials of another user that does have administrator rights. This admin account (not called admin) was created specifically for me to use (similar admin accounts have been created for other users). Initially I installed Windows Terminal from the Windows Store under the non-admin user. Discovering that I had to change the Windows PowerShell execution policy to RemoteSigned in order to use posh-git I tried to open an admin Terminal instance in order to run `Set-ExecutionPolicy`. This is something that works fine on my local machine because the same user I use remotely is a local administrator on my local machine. With no Windows Terminal instance already running, you can try to run Windows Terminal as an Administrator by right-clicking the Windows Terminal icon in the taskbar, right-clicking on 'Terminal' and selecting 'Run as administrator'. You can also right click the Terminal icon in the Start menu or 'Terminal' in the program list, select 'More' and then select 'Run as administrator'. A Windows 10 UAC dialog with the title "Do you want to allow this app to make changes to your device?" appears where I must enter a user name and password. After clicking the 'Yes' button, the UAC prompt goes away then reappears again exactly the same. If I enter the same admin credentials again and click the 'Yes' button the UAC dialog goes away and I see the following dialog: ![image](https://user-images.githubusercontent.com/2738319/177420612-7bc08727-7e97-4ea3-9e42-8a5c0f116840.png) The above dialog says "Windows cannot find 'C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.13.11431.0_x64__...\WindowsTerminal.exe'. Make sure you typed the name correctly, and then try again." If a non-admin instance of Windows Terminal is already running, if you use any of the above methods of selecting 'Run as administrator' the UAC prompt will appear then go away once the 'Yes' button in clicked but nothing else happens after that. If you use the Ctrl+click action on the 'Open new tab' control (the plus or + control) you see the UAC dialog once and then the same dialog. The UAC dialog lists the program as "Unknown program" with a path of "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.13.11431.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe". This does seem to be the path the Windows Terminal runs from in non-administrator mode. If you install Windows Terminal from the Windows Store and run it under the admin user profile everything works smoothly and you only every have to click the 'Yes' button in the UAC prompt to launch an admin Windows Terminal window. Installing Windows Terminal in the admin user profile does nothing to change the inability to launch Windows Terminal as the admin user from the non-admin user profile.
Author
Owner

@aamartin77 commented on GitHub (Sep 14, 2022):

After spending several hours on this, I finally figured it out!

Windows Terminal is a Microsoft Store app. When the Windows Terminal app is installed from the MS Store, it is installed under the current user's context. If Windows Terminal is installed from a non-admin user's account and the user attempts to run it as admin, Windows is unable to find the executable because it has not yet been installed under the admin user's context.

To resolve the problem, simply install Windows Terminal for BOTH the admin user AND the non-admin user.

Now, when a non-admin user attempts to elevate privilege with the admin account, Windows will call the Windows Terminal installed under the admin user's context. Work's like a charm!

@aamartin77 commented on GitHub (Sep 14, 2022): After spending several hours on this, I finally figured it out! Windows Terminal is a Microsoft Store app. When the Windows Terminal app is installed from the MS Store, it is installed under the current user's context. If Windows Terminal is installed from a non-admin user's account and the user attempts to run it as admin, Windows is unable to find the executable because it has not yet been installed under the admin user's context. To resolve the problem, simply install Windows Terminal for BOTH the admin user AND the non-admin user. Now, when a non-admin user attempts to elevate privilege with the admin account, Windows will call the Windows Terminal installed under the admin user's context. Work's like a charm!
Author
Owner

@sober-repay commented on GitHub (Sep 14, 2022):

Work's like a charm!

Except it doesn't. Every time the app needs updating, you're going to have to sign into the secondary account and update it there. This is a typical poor implementation from MS not thinking about how an enterprise tool is actually being used by enterprises.

@sober-repay commented on GitHub (Sep 14, 2022): > Work's like a charm! Except it doesn't. Every time the app needs updating, you're going to have to sign into the secondary account and update it there. This is a typical poor implementation from MS not thinking about how an enterprise tool is actually being used by enterprises.
Author
Owner

@kf0mlb commented on GitHub (Sep 14, 2022):

In win11 it is already installed and I still cannot runas admin.

@kf0mlb commented on GitHub (Sep 14, 2022): In win11 it is already installed and I still cannot runas admin.
Author
Owner

@bazzer007 commented on GitHub (Sep 19, 2022):

Work's like a charm!

Except it doesn't. Every time the app needs updating, you're going to have to sign into the secondary account and update it there. This is a typical poor implementation from MS not thinking about how an enterprise tool is actually being used by enterprises.

As I replied to you above, I do not think you're correct with that assertion.

@bazzer007 commented on GitHub (Sep 19, 2022): > > Work's like a charm! > > Except it doesn't. Every time the app needs updating, you're going to have to sign into the secondary account and update it there. This is a typical poor implementation from MS not thinking about how an enterprise tool is actually being used by enterprises. As I [replied to you above](https://github.com/microsoft/terminal/issues/12369#issuecomment-1036965167), I do not think you're correct with that assertion.
Author
Owner

@stephannn commented on GitHub (Oct 6, 2022):

Hi,

after my Terminal got updated and the Run As Admin command wasn’t working again I checked your comments that it is not a Terminal issue but a Store issue. So I exported following keys from my normal user and imported them to my admin one and the Terminal went back working again.

However, I am not sure which keys I really needed and I also had to change the owner of the last reg key (5) to be able to import it. Well, I am not sure if this will help or someone feels bored to put it into a script, but it is really sad how MS designed the store.

terminal1.reg.txt
terminal2.reg.txt
terminal3.reg.txt
terminal4.reg.txt
terminal5.reg.txt

Edit: terminal5 seems to be enough:

`$wt_version = $null

Get-ChildItem -Path "C:\Program Files\WindowsApps" | Where-Object { $.Name -like "Microsoft.WindowsTerminal*"} | ForEach-Object {
Get-ChildItem -Path $
.FullName | Where-Object { $.Name -eq "WindowsTerminal.exe"} | ForEach-Object {
$Matches = [Regex]::Matches($
.DirectoryName, '[\d.]+');
if($Matches[1].Value -gt $wt_version){
$wt_version = $Matches[1].Value;
}
}
}

if($wt_version -ne $null){

$regkey = "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Families\Microsoft.WindowsTerminal_8wekyb3d8bbwe"
Write-Host $wt_version
if(Get-Item -Path $regkey){
    $existkey = ([string](Get-ChildItem -Path $regkey | Select PSChildName).PSChildName)
    if($existkey){
        $newkey = $existkey -replace ([Regex]::Matches($existkey, '[\d\.]+').Value[1]), $wt_version
        if($newkey -ne $existkey){
            $sidobj = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544")
            $acl = Get-Acl ($regkey  )
            $person = New-Object System.Security.Principal.NTAccount( $sidobj.Translate([System.Security.Principal.NTAccount]) )        
            $access = [System.Security.AccessControl.RegistryRights]"FullControl"
            $inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit,ObjectInherit"
            $propagation = [System.Security.AccessControl.PropagationFlags]"None"
            $type = [System.Security.AccessControl.AccessControlType]"Allow"
            $rule = New-Object System.Security.AccessControl.RegistryAccessRule($person,$access,$inheritance,$propagation,$type)
            $acl.AddAccessRule($rule)
            $me = [System.Security.Principal.NTAccount]"$env:userdomain\$env:username"
            $acl.SetOwner($me)
            $acl | Set-Acl -Verbose

            #Rename-Item -Path ($regkey + "\" + $existkey) -NewName $newkey -Force -Verbose 
            New-Item -Path $regkey -Name $newkey
            New-ItemProperty  -Path ($regkey + "\" + $existkey) -Name "Flags" -Value 1 -PropertyType DWord
        }
    }
}

}`

@stephannn commented on GitHub (Oct 6, 2022): Hi, after my Terminal got updated and the Run As Admin command wasn’t working again I checked your comments that it is not a Terminal issue but a Store issue. So I exported following keys from my normal user and imported them to my admin one and the Terminal went back working again. However, I am not sure which keys I really needed and I also had to change the owner of the last reg key (5) to be able to import it. Well, I am not sure if this will help or someone feels bored to put it into a script, but it is really sad how MS designed the store. [terminal1.reg.txt](https://github.com/microsoft/terminal/files/9721737/terminal1.reg.txt) [terminal2.reg.txt](https://github.com/microsoft/terminal/files/9721741/terminal2.reg.txt) [terminal3.reg.txt](https://github.com/microsoft/terminal/files/9721742/terminal3.reg.txt) [terminal4.reg.txt](https://github.com/microsoft/terminal/files/9721743/terminal4.reg.txt) [terminal5.reg.txt](https://github.com/microsoft/terminal/files/9721744/terminal5.reg.txt) Edit: terminal5 seems to be enough: `$wt_version = $null Get-ChildItem -Path "C:\Program Files\WindowsApps\" | Where-Object { $_.Name -like "Microsoft.WindowsTerminal*"} | ForEach-Object { Get-ChildItem -Path $_.FullName | Where-Object { $_.Name -eq "WindowsTerminal.exe"} | ForEach-Object { $Matches = [Regex]::Matches($_.DirectoryName, '[\d\.]+'); if($Matches[1].Value -gt $wt_version){ $wt_version = $Matches[1].Value; } } } if($wt_version -ne $null){ $regkey = "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Families\Microsoft.WindowsTerminal_8wekyb3d8bbwe" Write-Host $wt_version if(Get-Item -Path $regkey){ $existkey = ([string](Get-ChildItem -Path $regkey | Select PSChildName).PSChildName) if($existkey){ $newkey = $existkey -replace ([Regex]::Matches($existkey, '[\d\.]+').Value[1]), $wt_version if($newkey -ne $existkey){ $sidobj = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") $acl = Get-Acl ($regkey ) $person = New-Object System.Security.Principal.NTAccount( $sidobj.Translate([System.Security.Principal.NTAccount]) ) $access = [System.Security.AccessControl.RegistryRights]"FullControl" $inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit,ObjectInherit" $propagation = [System.Security.AccessControl.PropagationFlags]"None" $type = [System.Security.AccessControl.AccessControlType]"Allow" $rule = New-Object System.Security.AccessControl.RegistryAccessRule($person,$access,$inheritance,$propagation,$type) $acl.AddAccessRule($rule) $me = [System.Security.Principal.NTAccount]"$env:userdomain\$env:username" $acl.SetOwner($me) $acl | Set-Acl -Verbose #Rename-Item -Path ($regkey + "\" + $existkey) -NewName $newkey -Force -Verbose New-Item -Path $regkey -Name $newkey New-ItemProperty -Path ($regkey + "\" + $existkey) -Name "Flags" -Value 1 -PropertyType DWord } } } }`
Author
Owner

@zadjii-msft commented on GitHub (Jan 6, 2023):

HUH I wonder if #14637 will help this... @jboelter thoughts?

@zadjii-msft commented on GitHub (Jan 6, 2023): HUH I wonder if #14637 will help this... @jboelter thoughts?
Author
Owner

@jboelter commented on GitHub (Jan 7, 2023):

@zadjii-msft I poked around at this a bit, forcing some failures by removing files, removing permissions, trying unprivileged user accounts, trying the non-store win10 build (unzipping in place). The various dialogs matched the failures I triggered. I don't have a Windows 10 machine around if it behaves differently.

e.g. removing permissions is different than missing files:

Screenshot_20230106_073208

The logic to elevate seems sound as it's just substituting the module name from WindowsTerminal.exe -> elevate-shim.exe. The elevate shim reverses that back to WindowsTerminal.exe.

@jboelter commented on GitHub (Jan 7, 2023): @zadjii-msft I poked around at this a bit, forcing some failures by removing files, removing permissions, trying unprivileged user accounts, trying the non-store win10 build (unzipping in place). The various dialogs matched the failures I triggered. I don't have a Windows 10 machine around if it behaves differently. e.g. removing permissions is different than missing files: <img width="419" alt="Screenshot_20230106_073208" src="https://user-images.githubusercontent.com/3619564/211172235-4655966a-3895-4470-8bf5-57093b368cc7.png"> The logic to elevate seems sound as it's just substituting the module name from `WindowsTerminal.exe` -> `elevate-shim.exe`. The elevate shim reverses that back to `WindowsTerminal.exe`.
Author
Owner

@Profile8647 commented on GitHub (Mar 6, 2023):

Here's a work-around I came up with to create a desktop shortcut using PowerShell/pwsh to launch Windows Terminal as admin from a limited account. It should survive updates and not require you to install Windows Terminal via a privileged user account to launch it from a limited user's context.

$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$env:USERPROFILE\Desktop\Windows Terminal (Admin).lnk")
$Shortcut.Arguments = "-NoProfile -NonInteractive -WindowStyle Hidden -Command Start-Process shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App -Verb RunAs"
$Shortcut.IconLocation = "$env:USERPROFILE\Pictures\Icons\Windows Terminal.ico"
$Shortcut.TargetPath = "pwsh.exe"
$Shortcut.Save()

Notes:

I hope this helps.

Update:

@Profile8647 commented on GitHub (Mar 6, 2023): Here's a work-around I came up with to create a desktop shortcut using PowerShell/pwsh to launch Windows Terminal as admin from a limited account. It should survive updates and not require you to install Windows Terminal via a privileged user account to launch it from a limited user's context. ```PowerShell $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$env:USERPROFILE\Desktop\Windows Terminal (Admin).lnk") $Shortcut.Arguments = "-NoProfile -NonInteractive -WindowStyle Hidden -Command Start-Process shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App -Verb RunAs" $Shortcut.IconLocation = "$env:USERPROFILE\Pictures\Icons\Windows Terminal.ico" $Shortcut.TargetPath = "pwsh.exe" $Shortcut.Save() ``` Notes: - I'm calling `pwsh` in `$Shortcut.Arguments` and `$Shortcut.TargetPath` but you can change this to `PowerShell`/`PowerShell.exe` if you don't have pwsh installed. - I'm using this .ico file for the shortcut: https://github.com/microsoft/terminal/issues/7682#issuecomment-695795199 I hope this helps. Update: - The command is more concise using the execution method mentioned here: https://github.com/microsoft/terminal/pull/14637#issue-1521564902
Author
Owner

@B-Art commented on GitHub (May 2, 2023):

The following works for starting Windows Terminal with different user:
runas /user:[username@domain.com] "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.16.10262.0_x64__8wekyb3d8bbwe\wt.exe"

Use Double Quotes when you want to make a link:
C:\Windows\System32\runas.exe /user:[username@domain.com] "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.16.10262.0_x64__8wekyb3d8bbwe\wt.exe"

You can use "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.16.10262.0_x64__8wekyb3d8bbwe\wt.exe" for the Icon.

@B-Art commented on GitHub (May 2, 2023): The following works for starting Windows Terminal with different user: runas /user:[username@domain.com] "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.16.10262.0_x64__8wekyb3d8bbwe\wt.exe" Use Double Quotes when you want to make a link: C:\Windows\System32\runas.exe /user:[username@domain.com] "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.16.10262.0_x64__8wekyb3d8bbwe\wt.exe" You can use "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.16.10262.0_x64__8wekyb3d8bbwe\wt.exe" for the Icon.
Author
Owner

@feldegast commented on GitHub (May 15, 2023):

i have this issue, but
If I have UAC behaviour of the elevation prompt set to prompt for credentials it prompts for login details twice and then fails to work but
if I have UAC behaviour of the elevation prompt set to prompt for consent it works fine with administrator rights....

@feldegast commented on GitHub (May 15, 2023): i have this issue, but If I have UAC behaviour of the elevation prompt set to prompt for credentials it prompts for login details twice and then fails to work but if I have UAC behaviour of the elevation prompt set to prompt for consent it works fine with administrator rights....
Author
Owner

@dtlhlbs commented on GitHub (Apr 20, 2024):

This didn't use to happen, I'm sure I've been able to run my current installation as Administrator as required without having to install two copies for admin and non-admin users. It's only recently I've hit this issue.

@dtlhlbs commented on GitHub (Apr 20, 2024): This didn't use to happen, I'm sure I've been able to run my current installation as Administrator as required without having to install two copies for admin and non-admin users. It's only recently I've hit this issue.
Author
Owner

@feldegast commented on GitHub (Apr 20, 2024):

it looks like i can right click on a desired terminal profile inside windows terminal and select 'run as administrator' using Windows Terminal Preview Version: 1.20.10822.0
this i think i could not do before....
i only have one version installed

@feldegast commented on GitHub (Apr 20, 2024): it looks like i can right click on a desired terminal profile inside windows terminal and select 'run as administrator' using Windows Terminal Preview Version: 1.20.10822.0 this i think i could not do before.... i only have one version installed
Author
Owner

@dtlhlbs commented on GitHub (Apr 21, 2024):

it looks like i can right click on a desired terminal profile inside windows terminal and select 'run as administrator'

That would be great, but it doesn't work for me. I can see that option and enter credentials when asked, but no new tab opens.

@dtlhlbs commented on GitHub (Apr 21, 2024): > it looks like i can right click on a desired terminal profile inside windows terminal and select 'run as administrator' That would be great, but it doesn't work for me. I can see that option and enter credentials when asked, but no new tab opens.
Author
Owner

@feldegast commented on GitHub (Apr 21, 2024):

when i do it, i enter my credentials and a new window opwns with the new tab is in the new window
are you using Version: 1.20.10822.0?

@feldegast commented on GitHub (Apr 21, 2024): when i do it, i enter my credentials and a new window opwns with the new tab is in the new window are you using Version: 1.20.10822.0?
Author
Owner

@dtlhlbs commented on GitHub (Apr 21, 2024):

are you using Version: 1.20.10822.0

Ahh, no I'm still on 1.19.10821.0, the current Microsoft Store version.

@dtlhlbs commented on GitHub (Apr 21, 2024): > are you using Version: 1.20.10822.0 Ahh, no I'm still on 1.19.10821.0, the current Microsoft Store version.
Author
Owner

@feldegast commented on GitHub (Apr 21, 2024):

in the microsoft store, try installing Windows Terminal Preview so you get the version i have and see if it works better?
they can both be installed at the same time and you can remove each seperatly later depending on which you want to keep

@feldegast commented on GitHub (Apr 21, 2024): in the microsoft store, try installing Windows Terminal Preview so you get the version i have and see if it works better? they can both be installed at the same time and you can remove each seperatly later depending on which you want to keep
Author
Owner

@dtlhlbs commented on GitHub (Apr 22, 2024):

@feldegast It worked on Windows Terminal Preview 1.20.10822.0, thanks very much :)

@dtlhlbs commented on GitHub (Apr 22, 2024): @feldegast It worked on Windows Terminal Preview 1.20.10822.0, thanks very much :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16637