简体   繁体   English

是否可以显示远程连接的控制台?

[英]Is it possible to show a remote connected console?

I'm connected from a Linux machine to a Windows machine through winexe. 我通过winexe从Linux机器连接到Windows机器。 I log onto the Windows machine with a user on that machine. 我与该计算机上的用户一起登录Windows计算机。 I can run cmd.exe or powershell scripts. 我可以运行cmd.exe或Powershell脚本。

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. 现在我的问题是:如果我在计算机的桌面上,则远程连接到它,并通过cmd / powershell启动一些脚本,那么桌面用户看不到cmd / powershell窗口。 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. 如果我使用winexe的交互式参数,则会在桌面上收到一条消息,指出需要注意交互式服务,但是当我查看它时,只有一个空的cmd窗口。 The output doesn't show. 输出不显示。

Is there a way to show the cmd window that is used by the remote user? 有没有办法显示远程用户使用的cmd窗口?

Try executing your script using psexec and specifying the interactive session switch. 尝试使用psexec执行脚本并指定交互式会话开关。 Something like: 就像是:

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

psexec psexec

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM