开发者

PSEXEC not redirecting 7zip output

开发者 https://www.devze.com 2023-04-07 01:22 出处:网络
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.

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 b开发者_Go百科ut 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号