• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 124
  • Last Modified:

An Easy VB Question with 90 points

I want to make a setup program that will serch the Hard drive for files already installed. I have the install part done, I just need the command to find the files.
0
R_N_WARD
Asked:
R_N_WARD
  • 3
1 Solution
 
JBakerCommented:
you can use the DIR $ function to search through your directories

ex.
Dir$("c:\*.*")

0
 
Erick37Commented:
"HOWTO: Search Directories to Find or List Files"
http://support.microsoft.com/support/kb/articles/q185/4/76.asp

"PRB: Search Using OpenFile API Instead of Dir/Dir$ Function"
http://support.microsoft.com/support/kb/articles/q168/5/19.asp
0
 
JBakerCommented:
If you know the files you are looking for you can do the following:

Dim MyFile, MyPath, MyName
' Returns "WIN.INI"  if it exists.
MyFile = Dir("C:\WINDOWS\WIN.INI")  

The string MyFile will be filled if the file exists.  If it does not exist the string will be null.
0
 
R_N_WARDAuthor Commented:
Thank you. The Dir$(C:\*.*) command should work fine. Newbe Q> "*.*" is the file I am looking for, right?
0
 
JBakerCommented:
you can use *.* or the specfic file you are looking for
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now