Sysinternals psexec not running on the remote desktop
Asked Answered
D

1

0

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?

Dyeing answered 24/6, 2016 at 3:1 Comment(1)
What error is returned?County
W
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.

Wraith answered 24/6, 2016 at 3:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.