user101442
user101442

Reputation: 2517

windows: command line used to launch a program

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

Upvotes: 2

Views: 500

Answers (4)

Grant Wagner
Grant Wagner

Reputation: 25931

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.

Upvotes: 0

b0x0rz
b0x0rz

Reputation: 3981

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)

Upvotes: 7

seanyboy
seanyboy

Reputation: 5693

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.

Upvotes: 3

foobarfuzzbizz
foobarfuzzbizz

Reputation: 58627

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

Upvotes: -3

Related Questions