Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Checking for a Directory and Returning File Info

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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

610 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