Link to home
Start Free TrialLog in
Avatar of R_N_WARD
R_N_WARD

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of JBaker
JBaker

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"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
Avatar of JBaker
JBaker

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.
Avatar of R_N_WARD

ASKER

Thank you. The Dir$(C:\*.*) command should work fine. Newbe Q> "*.*" is the file I am looking for, right?
you can use *.* or the specfic file you are looking for