Running an external program

  • Thread starter Thread starter Simon Jefferies
  • Start date Start date
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
 
* "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")'.
 
Back
Top