Wednesday, January 9, 2013

How to use sxstrace.exe

Are you not able to run your binary and getting error message which says try using sxstrace.exe to debug the issue ? 

You need to follow below mentioned steps to debug and create the log file out of your binary.

The binary is present at location: 


You need to have administrative privilege for running the above tool. 

  • Open Command Prompt
    • Open command prompt with administrative rights
  • Start Trace
    • run the following command:
C:\> sxstrace.exe Trace -logfile:test.log
    • Note that the above command should be run in the directory where you have write permission as sxstrace.exe will try to write the log file "test.log" in the current working directory.
  • Run your program
    • now try running your binary (either directly from explorer or open another command prompt to run the same) and click OK when you get your error message.
  • Stop Trace
    • Press Enter key in the command prompt to stop the trace.
  • Convert log to readable format
    • The generated test.log file is a binary formatted file. this needs to be converted to human readable format (txt). Run the following command:
C:\> sxstrace.exe Parse -logfile:test.log -outfile:test.txt
    • Above command parses the binary log file and generates a text output file.

Hope the above tip will help !! 

Cheers !!

No comments:

Post a Comment