Anything similar to C's "System()" function?

B

beaker

Hello,

I'm trying to call a program (and/or batch file) from a command line
from within a standalone VB.NET application - something I would have
done using the "System()" function if I was working in C.

The only way I've found so far is

System.Diagnostics.Process.Start("blah.exe in out")

(I'll be creating 'in' and processing 'out' from within my app).

Is this the best way to do it? Is there a way to suppress the DOS box
that briefly flashes up?

Thanks in advance for any advice,

Gary
 
H

Herfried K. Wagner [MVP]

beaker said:
I'm trying to call a program (and/or batch file) from a command line from
within a standalone VB.NET application - something I would have done using
the "System()" function if I was working in C.

The only way I've found so far is

System.Diagnostics.Process.Start("blah.exe in out")
Yes.

(I'll be creating 'in' and processing 'out' from within my app).

Is this the best way to do it? Is there a way to suppress the DOS box
that briefly flashes up?

You may want to check out the 'ProcessStartInfo' class and its 'WindowStyle'
and 'CreateNoWindow' properties. Maybe this solves your problem.
 
B

beaker

Herfried said:
You may want to check out the 'ProcessStartInfo' class and its
'WindowStyle' and 'CreateNoWindow' properties. Maybe this solves your
problem.

It did indeed solve my problem!

Thanks for the help.


Gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top