Reputation: 2517
How can I find out the command line options a program was launched with under windows?
Upvotes: 2
Views: 500
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
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
Reputation: 5693
On vista... You can
To do this programatically, run "tasklist -v" to a file and then split up the file.
Upvotes: 3