views:

115

answers:

1

Hi,

I have a console app (written in c#) that is passed various arguments from the command line by an external application (an InstallShield exe). Without adding code into the console app or InstallShield exe to log the value of arguments is there any way to see the value of the arguments passed to the console app? (perhaps via some sort of process monitoring app)

Any suggestions would be very helpful!

Cheers

Tim

+6  A: 

The excellent and free Sysinternals Process Explorer will do what you want. Highlight the process, right-click, choose Properties, and on the dialog that opens you'll see a "Command line:" section that lists the arguments passed to your executable:

Process Explorer's process dialog
(Image source: Process Explorer - A Free Powerful Replacement for Windows Task Manager)

Chris W. Rea
Thanks, that's just what I'm looking for!
tt83
You're welcome. BTW, Process Explorer does **so** much more. You'll enjoy spending some time learning what it can do. It's a tool worth learning about.
Chris W. Rea
Note that this information is *not guaranteed to be accurate*. A program which wishes to fool process explorer into believing that it had an entirely different arguments is free to do so. See http://blogs.msdn.com/oldnewthing/archive/2009/02/23/9440784.aspx for details.
Eric Lippert
@Eric Lippert: +1 Excellent point. Hook CreateProcess()? :-)
Chris W. Rea