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 wwant to catch the command-line arguments of a program I use, so when I start test.exe with arguments -debug and -console I can see this arguments even if I don´t have the source code of the program?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

wmic process where caption="test.exe" get commandline
(you may of course also start wmic and then interactively query various properties of your system (processes included) if you wish so. wmic /? will show you options)

Edit: if you prefer GUI in win7 you should be able to select additional column (under view->select columns) named 'command line' (not sure exact wording) in Task Manager to show what you need;

And finally, you could hook up a debugger (or anything posing as a debugger, I used simple cmd /k echo as debugger target) via Image Execution Options

share|improve this answer
    
+1, But I've read this is not reliable for some programs because the program is able to manipulate what appears there. –  dbenham Dec 29 '12 at 14:34
    
@dbenham Do you have a source? I'm not questioning it, just wanted to read on? –  wmz Dec 29 '12 at 15:00
    
I just googled and found How to clear a process command line? on SO. It makes sense that a process may need to manipulate the stored command line. You probably don't want the password you typed into the command line to be easily accessible. –  dbenham Dec 29 '12 at 15:33
    
Here is a good discussion from Raymond Chen's BLOG The Old New Thing: How do I get the command line of another process? –  dbenham Dec 29 '12 at 17:30
    
@dbenham Thanks - and see my edit, this will stop the process execution so it won't be able to modify it's command line. –  wmz Dec 29 '12 at 18:03

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.