Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start program from program 1

Status
Not open for further replies.

Ragnarox

Programmer
Oct 2, 2003
141
US
Hello all,

I am writing a startup program for everyon to use and here is what it does.

1. Check and make sure local exe is same as server exe
2. If not save copy server files to local directory
3. Start next program

I cant figure out how to start up that second program, so if someone knows anything about, I would appreciate the help.

Any help, as always, is greatly appreciated.

Brian
 
If you're talking about an external program then see System.Process.Start

Maybe this world is another planet’s Hell.
Aldous Huxley

 
Try something like this:

Code:
Imports System.Diagnostics
Imports System.IO

Public Class MEMCStart

  Public Shared Sub Main()

    File.Copy("C:\Data\MEMC\MEMC\bin\MEMC.exe", "C:\Data\MEMCRun\MEMC.exe", True)
    File.Copy("C:\Data\MEMC\MEMC\bin\MEMCGlobals.dll", "C:\Data\MEMCRun\MEMCGlobals.dll", True)
    File.Copy("C:\Data\MEMC\MEMC\bin\MEMCPlugInManager.dll", "C:\Data\MEMCRun\MEMCPlugInManager.dll", True)

    Dim psi As New ProcessStartInfo
    psi.FileName = "MEMC.exe"
    psi.WorkingDirectory = "C:\Data\MEMCRun\"
    Dim p As Process = Process.Start(psi)
    Application.Exit()

  End Sub

End Class

which is an extract from a statup program I use


Hope this helps.
 
bigtimmin

Thanks a bunch, that is one that i could not find at all.

Thanks

Brian
 
bigtimmin, System.Process.Start?, shouldn't this be System.Diagnostics.Process.Start?
 
Yup, yer rit earthandfire!

Maybe this world is another planet’s Hell.
Aldous Huxley

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top