Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass Arguments to EXE

Tags:

process

vb.net

I have a button with this code

Process.Start("start system\now.exe")

Now I'd like to pass arguments from the Texbox but I dont know how . I've tried :

Process.Start("system\now.exe -connect -ip 127.0.0.1 -PORT 910 " & "-USER " & TextBox1.Text & "-PWD " & TextBox1.Text " -serial x4r7680")

But does not seem to work. Any idea guys?

like image 231
dddddad Avatar asked Jan 31 '26 20:01

dddddad


1 Answers

You need to pass in a ProcessStartInfo object with the arguments. See the page in the MSDN docs for info on the ProcessStartInfo class.

Based on a cursory reading of the document, your example would look like this:

Dim startInfo as ProcessStartInfo("system\now.exe")
startInfo.Arguments = "-connect -ip 127.0.0.1 -PORT 910 " & "-USER " & TextBox1.Text & "-PWD " & TextBox1.Text " -serial x4r7680"
Process.Start(startInfo)
like image 179
kdmurray Avatar answered Feb 03 '26 10:02

kdmurray