Sysinternals psexec 未在远程桌面上运行 [英] Sysinternals psexec not running on the remote desktop

查看:56
本文介绍了Sysinternals psexec 未在远程桌面上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个由 Hyper-V 托管的远程桌面.

I've got two Remote Desktops hosted by a Hyper-V.

在远程桌面A"上,我有一个 .bat 文件,我想执行它.

On Remote Desktop "A", I've got a .bat file, which I want to execute.

在远程桌面B"上,我打开了一个带有 psexec cmd 的 cmd,准备调用机器A"上的 .bat 文件.

On Remote Desktop "B", I've got a cmd open with psexec cmd ready to invoke .bat file on machine "A".

"path-to\\psexec.exe" \\ip -u domain\username -p pswd -i cmd.exe /c "path-to\\myFile.bat %*"

机器A"上的 .bat 文件中包含的脚本在 UI 上运行,因此需要打开一个真实的屏幕,所以我同时连接到两个 RD.但是,当我在机器B"上调用 psexec 命令时,cmd 返回错误,但如果我直接通过服务器的 Hyper-V 管理器界面打开 RDA",psexec 命令会按预期工作.

The script contained in .bat file on machine "A" operates on the UI and thus requires a real screen to be open, so I am connected to two RDs simultaneously. However, when I call psexec command on machine "B", the cmd returns an error, but if I open RD "A" directly through the server's Hyper-V manager's interface, the psexec command works as expected.

谁能解释一下为什么会这样?

Can someone explain please why this happens?

推荐答案

Windows 的 UI 运行在 会话 0.要远程运行使用会话 0 的程序,它需要以系统用户身份运行(-s 标志),您可以指定要使用的会话(-i旗帜).这个答案也有一些相关的提示.

The UI of Windows runs on session 0. To run a program remotely that uses session 0, it will need to run as the System user (-s flag), and you can specify the session to use (-i flag). This answer has a few related tips too.

这篇关于Sysinternals psexec 未在远程桌面上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆