On Oct 2, 1:30 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Oct 2, 5:31 am, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On Oct 1, 11:34 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrote:
"kimiraikkonen" <kimiraikkone...@gmail.comschrieb:
I want my external app run without specifying a certain path. It's
enough to be in the same folder with my vb.net exe.
\\\
Imports System.Diagnostics
Imports System.IO
...
Dim ExecutablePath As String
ExecutablePath = Path.Combine(Application.StartupPath, "foo.exe")
Process.Run(ExecutablePath)
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Is there a shorter way?
Shorter way? Why the heck does that matter?
Anyways, you could do it in one giant, sloppy (imo), line:
Process.Run(Path.Combine(Application.StartupPath, "foo.exe"))
However, in my opinion being verbose is much better than trying to
make a "short" program. When you go to in to perform maintenance on
your code it is much more difficult to work with compact code.
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
Seth,
I understood and i agree that i don't like short coding but i want a
well-organized and well-understandable codings. That's why i asked the
shorter way meaning if there are alternative coding methods for
specifying root folder.
However look at this, there 2 problems:
1-I cannot hide my "foo.exe" while it's processing until it finishes,
it still present on the screen,
2-Between which lines should i put appstartup path for running
everyfolder where my project is installed?
Dim myProcess As System.Diagnostics.Process = New
System.Diagnostics.Process()
myProcess.StartInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Hidden
myProcess = System.Diagnostics.Process.Start("c:
\foo.exe")
myProcess.WaitForExit()
MsgBox(" Completed Successfully", MsgBoxStyle.Information,
"Completed")