PSEXEC 不重定向 7zip 输出
我正在尝试使用 PSEXEC 在远程计算机中解压缩自解压文件(使用 7zip 创建的控制台 exe),并在屏幕上查看结果。
远程命令执行得很好,但我在本地看不到它的输出。
这是我正在使用的命令:
PSEXEC.exe \MACHINE_NAME -u USER_NAME -p PASSWORD -w "\JCOLIN\TWClient" cmd /c "\JCOLIN\TWClient\TW1.17.19.exe" -y
我也尝试过:
PSEXEC.exe \MACHINE_NAME -u 用户名 -p 密码 -w "\JCOLIN\TWClient" cmd /c "\JCOLIN\TWClient\TW1.17.19.exe" -y > “\JCOLIN\TWClient\TW1.17.19.exe.log”
以便将结果保存在日志文件中,然后使用 TYPE 命令检索内容,但即使创建日志文件它始终为空
我也尝试过:
PSEXEC.exe \MACHINE_NAME -u 用户名 -p 密码 -w "\JCOLIN\TWClient" cmd /c "\JCOLIN\TWClient\TW1.17.19.exe" -y 2 > “\JCOLIN\TWClient\TW1.17.19.exe.log”,
但在这种情况下,PSEXEC 输出保存到文件中,而不是 TW1.17.19.exe 的输出。
顺便说一下,我也尝试过用 WinRAR 创建的控制台 SFX,但也有同样的问题。我只是不明白为什么 PSEXEC 可以重定向某些程序的输出,而不能重定向其他程序的输出。
您知道如何在屏幕上获得所需的输出吗?
预先感谢您的帮助。
I'm trying to use PSEXEC to uncompress a self extracting file (a console exe created with 7zip) in a remote machine and view the results on my screen.
The remote command executes just fine, but I don't see it's output locally.
This is the command I'm using:
PSEXEC.exe \MACHINE_NAME -u USER_NAME -p PASSWORD -w "\JCOLIN\TWClient" cmd /c "\JCOLIN\TWClient\TW1.17.19.exe" -y
I also have tried:
PSEXEC.exe \MACHINE_NAME -u USER_NAME -p PASSWORD -w "\JCOLIN\TWClient" cmd /c "\JCOLIN\TWClient\TW1.17.19.exe" -y > "\JCOLIN\TWClient\TW1.17.19.exe.log"
in order to save the results in a log file and then retrieve the contents using the TYPE command but even if the log file is create it is always empty
I also have tried:
PSEXEC.exe \MACHINE_NAME -u USER_NAME -p PASSWORD -w "\JCOLIN\TWClient" cmd /c "\JCOLIN\TWClient\TW1.17.19.exe" -y 2> "\JCOLIN\TWClient\TW1.17.19.exe.log"
but in this case the PSEXEC output is saved to the file, not TW1.17.19.exe's output.
By the way, I also tried with a console SFX created with WinRAR with the same problem. I just do not understand why PSEXEC can redirect output from some programs and not others.
Do you have any idea on how to get the desired output on my screen?
Thank you in advance for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试在重定向符号之前添加转义字符“^”(^> 而不是仅 >):
PSEXEC.exe \MACHINE_NAME -u USER_NAME -p PASSWORD -w "\JCOLIN\TWClient" cmd /c " \JCOLIN\TWClient\TW1.17.19.exe" -y ^> "\JCOLIN\TWClient\TW1.17.19.exe.log"
这应该会导致重定向发生在远程计算机上,而不是本地计算机上。
You might try putting an escape character, "^", before the redirection symbol (^> instead of just >):
PSEXEC.exe \MACHINE_NAME -u USER_NAME -p PASSWORD -w "\JCOLIN\TWClient" cmd /c "\JCOLIN\TWClient\TW1.17.19.exe" -y ^> "\JCOLIN\TWClient\TW1.17.19.exe.log"
This should cause the redirection to occur on the remote machine, not the local machine.