2

I wish to know if an application is running and what commands line arguments were passed on to it, if so.

While I can find out if the application is indeed running, I am not sure how I can retrieve the command line arguments which were passed on to it.

Is there a way to figure this out using C++ or Qt?

Thank you.

user1173240
  • 1,455
  • 2
  • 23
  • 50
  • It depends on the operating system (unless there's something portable in Qt). On Linux, you can read them from `/proc//cmdline` – Mike Seymour Sep 17 '14 at 11:34
  • That is for the current running process. I wish to know, in my application A, the command line argument(s) which might have been passed to an application B, which is already running. – user1173240 Sep 17 '14 at 11:44
  • This linked [article might help](http://www.codeproject.com/Articles/19685/Get-Process-Info-with-NtQueryInformationProcess), you can also use [WMI](http://blogs.msdn.com/b/oldnewthing/archive/2009/11/25/9928372.aspx), you would have to translate the script here though. – Niall Sep 17 '14 at 11:59
  • http://stackoverflow.com/questions/9589431/getting-the-command-line-arguments-of-another-process-in-windows – vahancho Sep 17 '14 at 12:03

0 Answers0