Get the parameters/arguments being called to an executable

Lets say you have some program ‘A’ that has no documentation and no help files but is being executed by some program ‘B’. You want to run program ‘A’ is individually, but you need to know what parameters/arguments are being passed from program ‘B’.

The following executable will help. Replace program ‘A’ (temporarily) with the following executable. Once program ‘B’ executes this new program, the parameters will be displayed in a message box.

Download getparams.exe

Source code below;

    Public Sub main()
        Dim msg As String = vbNullString

        Dim separators As String = " "
        Dim commands As String = Microsoft.VisualBasic.Command()
        Dim str() As String = commands.Split(separators.ToCharArray)

        Dim i As Long

        For i = 0 To UBound(str)
            msg = msg & str(i).ToString & vbCr
        Next

        MsgBox(msg)
    End Sub

Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *