I have two programs:

When A.exe is running, it calls B.exe with a series of arguments.

Any suggestions as to how can I see these arguments? I could write another B.exe program to do that, but it sounds more complicated than it needs to be.



Have a look at Process Explorer, which comes from sysinternals.


| improve this answer | |
  • 1
    and what if process lives < 2 secs, so Process Explorer wont just show it even if refresh timeout is large? – kagali-san Nov 19 '10 at 2:14
  • 3
    @mhambra, in that case, the OP should write another B.exe that just logs the passed arguments. – OscarRyz Nov 19 '10 at 2:23
  • sure.. just thought of some universal profiler for tracing mingw's compilations (not c:\bin\sh). – kagali-san Nov 19 '10 at 2:34
  • 1
    @mhambra, in that case, apimon and set filter on CreateProcess calls maybe helps, but I didn't try it myself cuz I'm in Debian now. I found this: goo.gl/hWrvE so called strace for Win32 but I didn't test it so not sure if it works. – Xiè Jìléi Nov 19 '10 at 7:07

I think Windows SDK has xperf.exe and it can trace process calls too. Not sure. Not a Win* man.

| improve this answer | |

This should work on Windows an Linux, but I'm not sure:

import sys
print sys.argv #This prints a list of all arguments
if '--option' in sys.argv:
    pass #do something
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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