|
-
Mar 26th, 2011, 10:22 AM
#1
Thread Starter
New Member
[RESOLVED] How do you find the Install Path/Location of the EXE?
I want to create a button that opens a supplied word document in their standard word handler like office or openoffice. But how do you find the Location of the exe (Or its folder) and using it to open the Word Document.
I have tried to use
VBCode Code:
Function GetFilenameOnly(ByVal Fullpath As String) As String
Return System.IO.Path.GetFileNameWithoutExtention(FullPath)
End Function
with no use. Please help!
-
Mar 26th, 2011, 10:54 AM
#2
Re: How do you find the Install Path/Location of the EXE?
If you want to open a data file in the default application for that file type, you don't have to know what that application is. You just call Process.Start and pass the path of the data file and the system will do the rest. It's just as though you double-clicked the data file in Windows Explorer.
-
Mar 26th, 2011, 04:35 PM
#3
Thread Starter
New Member
Re: How do you find the Install Path/Location of the EXE?
 Originally Posted by jmcilhinney
If you want to open a data file in the default application for that file type, you don't have to know what that application is. You just call Process.Start and pass the path of the data file and the system will do the rest. It's just as though you double-clicked the data file in Windows Explorer.
What i want is a method to find the location of the folder with the exe, since it can be installed anywhere on the harddrive. Then I need to open the word file inside that folder.
-
Mar 26th, 2011, 04:53 PM
#4
Member
Re: How do you find the Install Path/Location of the EXE?
The code your looking for is:
Application.StartupPath
For me thats a life saver )
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|