Logging PSexec ‘TIMEOUT’ event

  batch-file, logging, psexec, python, timeout

I’m executing PSexec SNMP command from Python to remote PC using a batch file and expecting to get ‘TIMEOUT’ in the SNMP response, and I want to save this ‘TIMEOUT’ event to a log file.
But the log file created is empty, I ran it manually and see the ‘TIMEOUT’ event in CMD window but again not in the log file.
When I’m sending other SNMP commands and getting replay the log file contains the SNMP output.

example for the command execution (I want "Timeout: No Response from" to be in the log file):

c:/temp/Tools/SNMP/snmpget xx xx xx xx xxxxx xxxxxx xx >1234.txt
Timeout: No Response from

Source: Python Questions