Running an external program

S

Simon Jefferies

Hello,

How do I run the appropriate application if I only know the type of file.

E.g. If I have a word document or image and I want it to run the registered
viewer etc..

TIA
Simon Jefferies
Tools Programmer,
Headfirst Productions
 
H

Herfried K. Wagner [MVP]

* "Simon Jefferies said:
How do I run the appropriate application if I only know the type of file.

Opening a file:

\\\
Imports System.Diagnostics

..
..
..
Dim psi As New ProcessStartInfo()
psi.UseShellExecute = True
psi.FileName = "C:\bla.html"
Process.Start(psi)
..
..
..
///

Starting an application:

If you want to start an application, you can simply call
'System.Diagnostics.Process.Start("C:\bla.exe")' or in VB.NET
'Shell("C:\bla.exe")'.
 

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