?
Solved

Checking for a Directory and Returning File Info

Posted on 1998-06-21
3
Medium Priority
?
198 Views
Last Modified: 2010-05-03
This is a two part question. First part is easy, second is more difficult.  

First part is...How do I verify if a directory exists and if so do xxxx, if not then create it?

Second part - How do I call or retreive a File's Product Name, Description, and Version Number information into 3 diffrent variables? I know this would only apply to files that had this info, and in this case I would be checking my own exe's.

Thanks in advance
0
Comment
Question by:UpAllNite
[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
3 Comments
 

Accepted Solution

by:
spurssy earned 100 total points
ID: 1463948
you may try these codes...

Dim DirName as String

DirName = "c:\testdir"

if Dir(DirName, vbDirectory) <> "" Then
    'do XXXX
else
    Mkdir DirName
endif

I dun quite understand what you mean for the 2nd part, pls elaborate.
0
 
LVL 1

Expert Comment

by:michelv
ID: 1463949
Well the answer is correct, for a directory that does not exist in one-depth tree, but what if this directory doesn't exist:

C:\Temp\From\Here\Its\a\whole\new\directory

and eg. C:\Temp does exist...

a MkDir "C:\Temp\From\Here\Its\a\whole\new\directory"

won't work here...

You need recursive...

About the info in EXE files, search the web for PE-Header file desciption, there you'll find the answer, if you wan't more info on the above, just comment it and I'll try to answer...


Greetz,

Michel

0
 

Author Comment

by:UpAllNite
ID: 1463950
As far as the second part:  What I need to do is obtain the (Windows Properties Sheet Information) from each file that I specify (FileName,Product Name,File Description, Version Number) and place that in a listview.

File #1: abc.exe,Product Name,File Description,Version Number
File #2: efg.ocx,Product Name,File Description,Version Number
File #3: xyz.dll,Product Name,File Description,Version Number

After that I will loop through the list to process each file based on the information obtained above.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 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