Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing a new exe from within an exe
Message
From
23/04/2007 10:15:24
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
 
To
22/04/2007 16:03:41
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01216984
Message ID:
01218885
Views:
16
if you just want to launch an exe and nothing more then you can do
Dim myProcess As Process = Process.Start(exe file or other file)
Now if you want more control and define what type of window is to display, auguments that you want to pass to the exe, you can use the next code.
Dim processInfo As ProcessStartInfo
processInfo = New ProcessStartInfo("my.exe")
processInfo.Arguments = "anyarg"
processInfo.WindowStyle = ProcessWindowStyle.Normal
Dim myProcess As Process= Process.Start(processInfo)
myProcess.WaitForExit(5000) 
' this will wait 5 secs for the process to exit, then you can check if the myProcess.HasExit 
to see if the process had finish or if 5 secs has elapsed and the process is still running.
>>Nevermind, thanks...
>
>And the answer is .... ?
>
>~~Bonnie
Alexandre Palma
Senior Application Architect
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform