Hello,
Welcome to Microsoft Q&A!
According to your description, whether you want to get the CommandLine of another process? If so, I don't advise you to do this.
Win32 doesn’t expose a process’s command line to other processes. From Win32’s point of view, the command line is just a string that is copied into the address space of the new process. How the launching process and the new process interpret this string is governed not by rules but by convention.
For more details, I suggest you could refer to the Blog: How do I get the command line of another process?
Thank you.
Jeanine
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.