Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

share|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
add comment

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

share|improve this answer
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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