1

I'm connected from a Linux machine to a Windows machine through winexe. I log onto the Windows machine with a user on that machine. I can run cmd.exe or powershell scripts.

Now my problem: If I'm on the desktop of the machine, connect remotly to it and start some script through cmd/powershell then the cmd/powershell window is not visible to the desktop user. Both use the same user. I would like to have a visible window for the desktop user if a remote user started a script and it is running, so the commands and the output can be seen by the desktop user.

If I use the interactive argument of winexe then I get a message on the desktop that an interactive serivce needs attention, but when I look at it then there is only an empty cmd window. The output doesn't show.

Is there a way to show the cmd window that is used by the remote user?

4

1 回答 1

0

尝试使用psexec并指定交互式会话开关来执行您的脚本。就像是:

psexec.exe -i powershell.exe -executionpolicy bypass -file C:\myscript.ps1

psexec

于 2013-04-17T15:18:01.133 回答