1

I am using psexec tool to run a batch file in remote machine. Everything is good except that I am unable to see any batch output messages that we usually see in cmd window. I want these msgs on my local machine psexec shell window. Is there anyway to do that?

I am using the command as:

psexec -u admin -p tool@321 \\10.189.21.19 -s -d cmd.exe /c "C:\TEMP\output\batch_script.bat"

3
  • Have you tried cmd.exe /K rather than cmd.exe /C?
    – aschipfl
    Dec 24, 2015 at 12:35
  • No. Actually I am unaware of /c or /k parameters. maybe i ll try that
    – Aprilian8
    Dec 24, 2015 at 13:36
  • I tried replacing cmd.exe /K but not getting any messages with this one either.
    – Aprilian8
    Dec 24, 2015 at 14:20

1 Answer 1

1

What about creating an admin share and outputting the data there?

psexec -u admin -p tool@321 \10.189.21.19 -s -d cmd.exe /c "C:\TEMP\output\batch_script.bat >\\server\logs$\10.189.21.19.txt"

1
  • With this line its just outputting the lines from batch into log. I am talking about the CMD execution messages or response messages. I hope you understand.
    – Aprilian8
    Dec 24, 2015 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.