Sysinternals psexec not running on the remote desktop

我与影子孤独终老i 提交于 2019-12-13 22:41:27

问题


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

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

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 %*"

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?


回答1:


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.



来源:https://stackoverflow.com/questions/38004985/sysinternals-psexec-not-running-on-the-remote-desktop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!