Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Will This piece of code Check to see the directory ex

Posted on 2004-10-05
Medium Priority
Last Modified: 2010-04-23
I acutally used a reference from this site but I wanted to make sure and I honesly can't test it right now, Please let me know for an easy 50 pts. Thanks!

Public compiledpxp As String = "c:\cytodata\compiledpxp"
 Public save As String = "c:\cyotodata\save\originalpxp"

   If Not Len(Dir$(compiledpxp, vbDirectory)) > 0 Then
            Len(CObj((Dir$(compiledpxp, vbDirectory))).Createdirectory(compiledpxp))
        ElseIf Len(Dir$(save, vbDirectory)) > 0 Then
            Len(CObj((Dir$(save, vbDirectory))).Createdirectory(compiledpxp))
        End If
Question by:croag
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
  • 2

Author Comment

ID: 12232516
I should say - Will that little sniplet check if the given directories exsists, and if not, create them? If not, can you let me know where I'm going wrong? Thank you so much!
LVL 34

Expert Comment

ID: 12232558
It looks like Vb 6.0 to me

heres a .Net version that does the same thing

    Dim finfo As New System.IO.FileInfo("C:\temp\mydocuments\mfile.exe")
        Dim dir As System.IO.DirectoryInfo = finfo.Directory
        If Not dir.Exists Then
            MessageBox.Show("Directory created")
            MessageBox.Show("Directory exists")
        End If
LVL 34

Accepted Solution

flavo earned 200 total points
ID: 12232577
Dim DirInfo As New DirectoryInfo("C:\Temp")
If DirInfo.Exists Then    'Directory Exists
     'You are good to go...
End If

Author Comment

ID: 12232603
but there are no syntactical errors in the actual could this be?
LVL 34

Expert Comment

ID: 12232618
>> syntactical errors

Thats not the be all and end all.  There can be other reasons that will cause it not to work.  How did the code go that I posted

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

661 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