473,382 Members | 1,392 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,382 software developers and data experts.

Finding the path of an application?

Hi
How can I get the path of an application that has been
already installed on my PC using VB?

For example, I want my program to find and store the path
of Excel.exe

I think I have to search the registry, but I don't know
how. Any help?
Amjad
Nov 20 '05 #1
9 1570
Why do you need that?

I ask because you will have a problem with the location of applications that
are not registered.

Regards,
Morpheu

"Amjad" <am*********@hotmail.com> escreveu na mensagem
news:01****************************@phx.gbl...
Hi
How can I get the path of an application that has been
already installed on my PC using VB?

For example, I want my program to find and store the path
of Excel.exe

I think I have to search the registry, but I don't know
how. Any help?
Amjad

Nov 20 '05 #2
I want to extract data from a file that is created using a particular
software and stored in the same folder. Now since the user could have
installed that software anywhere on his hardisk, I would like to be able
to know where the created files are stored.

The software application is registered.

Amjad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3
* "Amjad" <am*********@hotmail.com> scripsit:
How can I get the path of an application that has been
already installed on my PC using VB?

For example, I want my program to find and store the path
of Excel.exe


This depends on the application you are looking for.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Well,
You know one key from registry where you can found this information?
If know you can retrieve this information.
Else you can make a function that uses filesystem to sweep disk searching
application for its name. It will be very slow.

Morpheu

"Amjad Farran" <am*********@hotmail.com> escreveu na mensagem
news:%2****************@TK2MSFTNGP09.phx.gbl...
I want to extract data from a file that is created using a particular
software and stored in the same folder. Now since the user could have
installed that software anywhere on his hardisk, I would like to be able
to know where the created files are stored.

The software application is registered.

Amjad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #5
Ok. Let's assume that I'm looking for the location path of Microsoft
Word (WinWord.exe)

Amjad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #6
* Amjad Farran <am*********@hotmail.com> scripsit:
Ok. Let's assume that I'm looking for the location path of Microsoft
Word (WinWord.exe)


I am not sure, if it will work on all versions:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\Winword.exe

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
In article <#r**************@TK2MSFTNGP10.phx.gbl>, Amjad Farran wrote:
Ok. Let's assume that I'm looking for the location path of Microsoft
Word (WinWord.exe)

Amjad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


You can try and use AssocQueryString to find an executable, or you can
use FindExecutable if you want to look it up by extension.

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #8

Thanks for replying. Can you give me the complete code line?

For example:

Dim myWinWordPath as String

myWinWordPath =
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App
Paths\Winword.exe

Amjad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #9
* Amjad Farran <am*********@hotmail.com> scripsit:
Thanks for replying. Can you give me the complete code line?

For example:

Dim myWinWordPath as String

myWinWordPath =
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App
Paths\Winword.exe


Sorry, that's a path in the registry. Have a look at the
'Microsoft.Win32.Registry' class.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #10

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

Similar topics

11
by: Fuzzyman | last post by:
What's the best, cross platform, way of finding out the directory a script is run from ? I've googled a bit, but can't get a clear answer. On sys.argv the docs say : argv is the script name...
12
by: jeff elkins | last post by:
I'm creating an app that relies on a configuration file at launch. The file will always exist in the app's installation directory, but I have no control over where that might be. Is there an...
22
by: Tony Houghton | last post by:
I'm using pygame to write a game called Bombz which needs to save some data in a directory associated with it. In Unix/Linux I'd probably use "~/.bombz", in Windows something like "C:\Documents...
1
by: Rob T | last post by:
I want to write a file into the directory my application is installed into. If I just write the file without a path, it will go to the user's working directory (ie, where he opened a file from)....
4
by: m | last post by:
Hello I need to find out full URL of my application name, I tried using Request.ServerVariables but it returns only serverername, and I need virtual directory name as well. Thnx in advance
2
by: David | last post by:
Hi, Would someone please mind showing me how to obtain the absolute path to a folder that is created under the application folder at install time. ie. On my development machine the path is...
2
by: Rik Hemsley | last post by:
Hi, I am looking for a way to discover the path to the ASP.NET temporary directory, which is called something like 'Temporary ASP.NET Files'. From within an ASP.NET application, I can get the...
9
by: Dave Booker | last post by:
When I run a particular application I've been working on for a while, it somehow finds a value for the Application Setting "Test.Properties.Settings.Default.ProjectPath", but I can't see where it...
5
by: ron.longo | last post by:
Is there any way that I can find the path of the main .py file of my application? For example, I have an application with some resources which are in a subdirectory: myPythonApp.py...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.