How to call another .exe in C#?

G

Galaxia

Hi,

I am using C# of VS .Net 2003.

I want to call another executable file (.exe) in my program. How can I do it?

Thanks.

--
"Forward Galaxia"
 
P

Publicjoe

Hi

Here is an example to run notepad.
System.Diagnostics.Process.Start( "notepad.exe" );


To run another application from your application, use the
System.Diagnostics.Process class. It is not necessary to create an instance
of the Process class to use it.

Simply pass a string containing the app you wish to run, to the process, as
below.

Process.Start( "myapp.exe" );

Hope this helps

Publicjoe

C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html
VB Tutorial at http://www.publicjoe.f9.co.uk/vbnet/vbnet.html
VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html
Mirrors at http://dowhileloop.com/publicjoe/ and
http://publicjoe.justbe.com/

Useful Articles at http://www.madsally.co.uk
 

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