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.

Ideas?

link|improve this question

feedback

3 Answers

up vote 7 down vote accepted

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

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

link|improve this answer
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
2  
@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. – Xie Jilei Nov 19 '10 at 7:07
feedback

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

link|improve this answer
feedback

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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