Solved

Find File Directory

Posted on 2013-05-15
2
288 Views
Last Modified: 2013-05-15
I would like a VB.Net or even VBA script that looks on the C:\ drive for an executeable and then sets a string variable to that path.

It would search only C:\Program Files\ or C:\Program Files (x86)\ folders

Once file is found it stops

myExecuteablePath = "foundFullPath"
0
Comment
Question by:lrbrister
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 39169432
dim strExe as string, strPath as string

strPath="C:\Program Files\"
strExe=dir(strPath & "*.exe")

while strExe <>""

      msgbox "The executable is " & strpath & strExe

      strExe=dir()
wend


strPath="C:\Program Files (x86)\"

strExe=dir(strPath & "*.exe")

while strExe <>""

      msgbox "The executable is " & strpath & strExe

      strExe=dir()
wend
0
 

Author Closing Comment

by:lrbrister
ID: 39169488
capricorn1

I mistated my question, which you answered correctly and efficiently.

I'm awarding points.
Please watch for new question
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now