Solved

Find File Directory

Posted on 2013-05-15
2
294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

737 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