2

How can I find out the command line options a program was launched with under windows?

3
  • Can you provide a little more detail please. Is this a program you've written, or any program that's been launched by the user?
    – ChrisF
    Commented Jul 21, 2009 at 12:28
  • awesome question. never needed this before, but it's an amazing idea in and of itself. do tell more, why you need it :)
    – b0x0rz
    Commented Jul 21, 2009 at 12:32
  • 1
    I assume that this belongs on superuser.
    – weiqure
    Commented Jul 21, 2009 at 12:36

4 Answers 4

7

try: http://www.bleepingcomputer.com/tutorials/tutorial132.html

in short: use the Process Explorer utility created by Sysinternals (now owned by Microsoft; which is probably why vista and windows 7 now have a similar functionality already present in task manager)

1
3

On vista... You can

  • go to the task manager
  • Click View --> Select Columns
  • Add the command line column.

To do this programatically, run "tasklist -v" to a file and then split up the file.

0

If you are trying to get the command line of another process programmatically you should probably read Why is there no supported way to get the command line of another process?:

Commenter Francisco Moraes wonders whether there is a supported way of getting the command line of another process. Although there are certainly unsupported ways of doing it or ways that work with the assistance of a debugger, there's nothing that is supported for programmatic access to another process's command line, at least nothing provided by the kernel. (The WMI folks have come up with Win32_Process.CommandLine. I have no idea how they get that. You'll have to ask them yourself.)

If you are trying to retrieve the command line of your own process you can use GetCommandLine.

-3

Try running the .exe but with the /? flag.

1
  • 1
    no. these are the POSSIBLE options. the question was AFTER the app started, what options WERE used.
    – b0x0rz
    Commented Jul 21, 2009 at 12:31

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