'Issues using psexec -i to launch interactive app

I'm connecting to a windows machine over SSH and would like to launch a GUI app in an existing interactive session.

This should work using psexec -i, but it fails for me in various ways:

  1. psexec -i 1 notepad.exe: notepad crashes without showing UI
  2. psexec -i 1 cmd.exe: I get a black box the size of a cmd.exe window, it never renders. If I look at the window title with "alt-tab", it does say this is an [Administrator] process which is not what I expected.
  3. psexec -i 1 <path to vscode>, it launches successfully but then raises a number of errors related to credential storage.
  4. psexec -s -i 1 cmd.exe: this launches fine, but the process is running as nt authority\system, which is not what I want.
  5. psexec -i 1 -u my_user -p my_pwd <path to vscode>: this works fine, but I can't require passwords and want to use ssh key-based auth instead.

I've seen a ton of questions/answers where it looks like '-i' works for people so I'm not sure what's going wrong here. Any ideas?



Solution 1:[1]

It could be due to incorrect session id. Can you check if the session id is correct, by navigating to users tab in the task manager

Screenshot of Session ID Screen

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gopalakrishnan