Question Send the Arguments to the Exe

soni_1985

Member
Joined
Jul 11, 2009
Messages
8
Programming Experience
1-3
Suppose I have two exes WindowsApplication1.exe WindowsApplication2.exe..On the form load of WindowsApplication2.exe,I m calling WindowsApplication1.exe & sending the command line arguements..I copy the WindowsApplication1.exe into the debug folder of WindowsApplication2.exe.

WindowsApplication2.exe
VB.NET:
  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Process.Start(Application.StartupPath & "\" & "WindowsApplication1.exe", "one" & "two")
    End Sub


WindowsApplication1.exe
VB.NET:
 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MsgBox(Command)
    End Sub


On form load of WindowsApplication2.exe,WindowsApplication1.exe is started & arguments are sent.
Now I want to check on form load of WindowsApplication2.exe,I do not want to start WindowsApplication1.exe, i just want to send the arguments to the WindowsApplication1.exe. Is is possible? To send the command line arguments to the ruunning exe.
 
It's not directly possible to send Arguments into a running program. If it is a console-program you could start it with the Process-class and redirect the Default-Input-Stream, and write into that one. Or you communicate over a TCP/IP-Tunnel, a named pipe, a simple plain file, the clipboard...

What do you want to achieve with this? F.e. sending a command to a running process so that it executes something?

Bobby
 
Back
Top