[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Checking for a Directory and Returning File Info

Posted on 1998-06-21
3
Medium Priority
?
213 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
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

Industry Leaders: 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

872 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