Click here to Skip to main content
16,004,564 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I'm tring to run an exe with C#.

C#
Process p = new Process();
p.StartInfo.FileName = (@"hacm.exe");
p.StartInfo.Arguments = "ProcID StringTable > porttest.txt";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.Start();

It is warning me "you must send ProcID". But how can I learn what is procid.

What I have tried:

I tried to see exe's codes. But not possible. Thanks.
Posted
Updated 25-Jun-24 18:40pm
v3
Comments
Pete O'Hanlon 24-Jun-24 15:37pm    
What is hacm? We can't supply answers without context.
George Swan 25-Jun-24 10:05am    
Each space in your arguments string acts as a separator for the arguments. So you are passing 4 arguments. Is that what you intended?

The only way to know what arguments are expected is either the documentation on the executable, or you could try running "hacm /?" in a CMD Prompt.
 
Share this answer
 
Without knowing what hacm.exe does, or having any access to it we can't be specific - but I suspect that you need to replace the literal "ProcID" in the Arguments string with the actual ID value that it is expected to work with. Your best bet is to look wherever you got the app from and either ask their tech support or read the documentation!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900