gpt4 book ai didi

psexec - 使用 PSEXEC 不会从远程任务返回任何输出

转载 作者:行者123 更新时间:2023-12-04 12:38:35 24 4
gpt4 key购买 nike

我正在使用 psexec 在服务器上运行 exe。
该命令运行正常,但我的本地控制台上没有输出。

这是我正在使用的命令:

psexec.exe \\my-machine ping localhost

这导致:
PsExec v1.94 - Execute processes remotely
Copyright (C) 2001-2008 Mark Russinovich
Sysinternals - www.sysinternals.com

ping exited with error code 0.

但是,如果我尝试在本地运行它,则它可以正常工作
psexec.exe \\localhost ping localhost

PsExec v1.94 - Execute processes remotely
Copyright (C) 2001-2008 Mark Russinovich
Sysinternals - www.sysinternals.com



Pinging my-machine.mydomain.com [1.1.1.1] with 32 bytes of data:

Reply from 1.1.1.1: bytes=32 time=2ms TTL=128
Reply from 1.1.1.1: bytes=32 time<1ms TTL=128
Reply from 1.1.1.1: bytes=32 time<1ms TTL=128
Reply from 1.1.1.1: bytes=32 time<1ms TTL=128

Ping statistics for 1.1.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 2ms, Average = 0ms
ping exited on localhost with error code 0.

最佳答案

事实证明(至少在这种情况下)您需要在启动 psexec 时使用完全限定的机器名称。
我还没有弄清楚为什么会这样,但它确实有效。

psexec.exe \\my-machine.mydomain.com ping localhost

现在返回命令的所有输出。

关于psexec - 使用 PSEXEC 不会从远程任务返回任何输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1221739/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com