473,383 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to run process from root folder

Hello,
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.

System.Diagnostics.Process.Start("c:\3rdpartyapp.e xe") is not OK for
me because everyuser should put it into c:\

i tried:

System.Diagnostics.Process.Start("3rdpartyapp.exe" ) with no success.
How can i specify root folder?

Oct 1 '07 #1
5 5366
"kimiraikkonen" <ki*************@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/>
Oct 1 '07 #2
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?

Oct 2 '07 #3
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

Oct 2 '07 #4
You could create a sub or function that take the exe file as an argument if
you need to use this several times for different exe files (read the
language specification at least once if needed)...

---
Patrice

"kimiraikkonen" <ki*************@gmail.coma écrit dans le message de news:
11**********************@22g2000hsm.googlegroups.c om...
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?

Oct 2 '07 #5
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")

Oct 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jerry | last post by:
I'm having just a bit of trouble wrapping my brain around the task of working with folders that are above the site's root folder. I let users upload photos (.jpg/.gif files) which can...
1
by: John Dalberg | last post by:
I have an asp.net app that is in a folder which is two levels under the website root folder. The website has a login.aspx which is in the root folder. How do I get the relative path to the web...
19
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However...
2
by: Jeff Brown | last post by:
Hi, I suspect that this isn't possible, but I figured I'd ask. My project has a root namespace, let's say it's "Root", that applies to almost every source file (which is why I've set it as the...
0
by: Carl Gilbert | last post by:
Hi I am trying to get a simple ASP.NET web application to work on my 1&1 (1and1) web space. I managed to get something working a while ago, with thanks to Karl Seguin, but for some unknown...
2
by: news.sbcglobal.net | last post by:
I hope I can explain this well enough to understand. I have a master page that is used by almost all of the pages in my site. On the master page is a table. In one of the cells in this table, I...
3
by: Chris | last post by:
I have created a site with VS2005, using asp.net/c#. When I try to deploy this site to our intranet asp server all of my links that were "~/Folder/Site.aspx" no longer work because when I move it...
3
by: Rick | last post by:
Hi, Our website used to have all pages in the root folder, and the entry page is "Login.aspx". I was asked to move all pages inside a folder named "Aspx" Is it possible to move also the...
2
by: Alex | last post by:
Hello, I'm creating a program to parse a directory and all files within that directory (including subdirectories), but 'directoryinfo' only parses the current directory. Is it possible to have...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.