Get list of all possible command line arguments for an exe

15,457

Solution 1

Thanks for all of your help. I was able to solve it by having someone start it manually and then log in, and then I checked this list of all running processes with this command:

"WMIC /OUTPUT:C:\ProcessList.txt PROCESS get Caption,Commandline,Processid"

I was then able to find exactly what was passed when it was run from the file that command generated and execute that command in PowerShell using something like:

$exp = "&'C:\path\to\the\exe.exe' /param1 /param2 /param3" invoke-expression $exp

Solution 2

There is no way to query the supported command line arguments. Try running the program from a command prompt with no arguments, with an invalid argument, with /h, /?, -h, --help and similar arguments to see if one of these prompts the program to output a list of allowed arguments.

Solution 3

search for universal silent switch finder. it is actually possible to do programmatically but requires deep diving into binary executable. if interested check http://code.google.com/p/pefile/wiki/PEiDSignatures

Share:
15,457
user609926
Author by

user609926

Updated on June 10, 2022

Comments

  • user609926
    user609926 almost 2 years

    Is there anyway for me to get the list of available command line arguments for an exe? I need to create a Powershell script that start the Relius Agent Manager program, but this program requires database login and password info to load.

    I can obtain the login/pass info, but I need to know the names of the argument I'll need to pass them through.

    It doesn't matter if I use Powershell or C# to retrieve the list of arguments, I just need to know their darn names.

    I read up on the Process class in C# but I don't see anything that will actually list the available arguments, only how to list what was passed when a process was started.